Raised This Month: $105 Target: $400
 26% 

EntSpawner


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   ALL        Category:   General Purpose        Approver:   Johnny got his gun (102)
Twilight Suzuka
bad
Join Date: Jul 2004
Location: CS lab
Old 09-16-2004 , 12:24   EntSpawner
Reply With Quote #1

Thanks to Johnny Boy, I fixed all the stupid mistakes, added a custom base dir to compile with rules, and added an arguement check, to stop the run time errors.

Putting a 0 in for things you DONT want to reset will render no run time errors, otherwise you'll get a runtime error, or arguement error.

Works with 0.16 (not for long though) and 0.20.

Tested, and functional.

Next project to be added: Trains and Misc, and Master command adder.

Currently implimented:
Triggers, Monsters, Lights.

Currently functioning:
All but snarks in TFC, and alien controllers in CS.
Attached Files
File Type: sma Get Plugin or Get Source (ent_spawning.sma - 3342 views - 42.6 KB)
File Type: zip enthelp.zip (29.1 KB, 2154 views)
__________________
Twilight Suzuka is offline
Send a message via AIM to Twilight Suzuka Send a message via MSN to Twilight Suzuka
ZeroTolerance
Junior Member
Join Date: Sep 2004
Old 09-16-2004 , 13:22  
Reply With Quote #2

yay...just one more question now...i haven't tested it yet, i'm about to now though, but where are you putting the enthelp folder or what are we doing w/ the files in there?
ZeroTolerance is offline
Send a message via AIM to ZeroTolerance
Twilight Suzuka
bad
Join Date: Jul 2004
Location: CS lab
Old 09-16-2004 , 16:32  
Reply With Quote #3

Put it in where ever base dir is, and its help files. for the help command.
__________________
Twilight Suzuka is offline
Send a message via AIM to Twilight Suzuka Send a message via MSN to Twilight Suzuka
Twilight Suzuka
bad
Join Date: Jul 2004
Location: CS lab
Old 09-16-2004 , 22:33  
Reply With Quote #4

Updated! Now no need for fun module! Also, a few things fixed, and ty for approving it. Yes!

UPDATE:
added shortcut commands, amx_spawn_shortcut, and amx_spawn_trigger_shortcut, for fast spawning of multiple things.
__________________
Twilight Suzuka is offline
Send a message via AIM to Twilight Suzuka Send a message via MSN to Twilight Suzuka
Anpheus
Senior Member
Join Date: Aug 2004
Old 09-17-2004 , 23:01  
Reply With Quote #5

Ok, Twilight can you compile a list in this format:

{ "nameofent", "classname", # of 3-unit vectors, 3 unit vectors (listed first), non-vector units }

some examples are:

Code:
	{	"trigger_hurt"		, 1, "origin", "dmg" , "damagetype"},
	{	"trigger_camera"	, 1, "origin", "acceleration",	"deceleration", "speed", "target", "targetname", "killtarget", "delay", "wait", "moveto", "flags"},
	{	"trigger_auto"		, 1, "origin", "flags", "triggerstate", "globalstate", "target", "killtarget", "delay"},
	{	"trigger_counter"	, 1, "origin", "netname", "flags", "sounds", "count", "message", "target", "killtarget", "delay"},
	{	"trigger_relay"		, 1, "origin", "flags", "triggerstate", "origin", "target", "killtarget", "delay"},
	{	"light"				, 2, "origin",	"_light", "style", "_fallout", "target", "targetname", "pattern", "_cone", "_cone2", "pitch", "_sky", "flags"},
	{	"light_environment" , 2, "origin", "_light", "pitch", "angles", "_fade", "_fallout", "targetname"},
	{	"light_generic"		, 2, "origin", "_light", "style", "_fade", "_fallout", "target", "targetname", "pattern", "flags"}
Now, is _light a 4 unit vector? If so, then those 2s must become ones.

Ideally, I will be able to reference types and their sizes (how many elements and of which type) but I don't know how right now.

Anyways... this information will allow me to process it in a module. As you can see, I started already. But uh, lazyness took over.




Eventually, the module function would be programmed to interpret entity values from a txt file, and thus allow you the ability to add entities 'on demand' or even via command by simply referencing the types.


See, now that would be nice, yes? Instead of recompiling a plugin, simply add a new line with new entity data and have a native for refreshing or loading new txt files.

Edit: Oh yes, this would allow for saving of critical entity data based on what vars the entity uses. Although some would have to be added such as mins, maxs, angle... etc. Essentially, any non-zero entry would have to be saved to the file.
Anpheus is offline
Twilight Suzuka
bad
Join Date: Jul 2004
Location: CS lab
Old 09-18-2004 , 09:52  
Reply With Quote #6

Arg, cant even finish one plugin before people want me to make it into a module...

...wait this exact situation never happened before...In any case,

Ents dont take things lin that particular format. You picked all the easy things, like the easier triggers, the lights,s tuff that doesnt take 20 arguements.

For instance, light_spot

<target> <targetname> <r,g,b,brightness> <cone> <cone2> <pitch> <sky> <style> <fade> <fallout> <flags> <pattern> <x,y,z>

Half of them need to be integers, some strings, theres a float in there somewhere. Its 18 different arguements and such, and most of them dont work if it isnt the correct one.

So untill I spend a lot of time on this, I want to see how you'll handle that.
__________________
Twilight Suzuka is offline
Send a message via AIM to Twilight Suzuka Send a message via MSN to Twilight Suzuka
Anpheus
Senior Member
Join Date: Aug 2004
Old 09-18-2004 , 12:29  
Reply With Quote #7

Simple, you pass -all- of those as strings into dispatchspawn. I've looked at your code. With the sole exception of _light you use strings every time. Usually it's just a string formatted into an integer. Formatted into a string.

Now would you care to explain the difference between the following:

read_argv(n, cone, 15)
dispatchkeyvalue(ent, "cone", cone)

and

read_argv([i]n[/n],cmd,31)
new cone = str_to_num(cmd)
format(szHolder5,15,"%i",cone)
DispatchKeyValue(entity,"_cone",szHolder5)


As far as I knew, reading the argument value puts it into a string.


If there are exceptions to the rule, a simple check could obtain whether or not the exception is present. Blending[2] is an entity property, for example. Another exception is _light. Which could be easily checked for.

Hell, I could leave it exception free, and enforce strict grammar to make it simpler. Ergo, instead of requiring:

make_ent(enttype, arg[0], arg[1], arg[2], ...) which uses the variables: { classname, origin, ... }, with arg[0] representing parsed arguments for the make_ent native... and then formatting origin as 3 different arguments...

You could parse it as a quoted block, and then it would be -automagically- through the science of arrays turned into an array of size equal to the number of arguments within the quote. So instead of passing make_ent("light_generic", "light", -300, -400, -100, ...) I could do make_ent("light_generic", "light", "-300 -400 -100", ...)

Because vectors are all floats, this means that any statement of that sort is handled perfectly.

Additionally, strings are passed into the function as strings regardless. The handling of these strings is simple, there's already a native AMX function for retrieving those strings.


So, where did I leave something out?
Anpheus is offline
Twilight Suzuka
bad
Join Date: Jul 2004
Location: CS lab
Old 09-18-2004 , 12:44  
Reply With Quote #8

Well, actually for things with integers, I formatted a string, or an arguement, into an int, then back into a string...which shouldnt work,but it does, for reasons unknown to me.

PM me the exact format you want stuff in, and I'll convert every thing over into that format.

{ "trigger_hurt" , 1, "origin", "dmg" , "damagetype"},

Doesnt exactly tell me what to do.

I guess I should delete this then, if its turning into a module?
__________________
Twilight Suzuka is offline
Send a message via AIM to Twilight Suzuka Send a message via MSN to Twilight Suzuka
Anpheus
Senior Member
Join Date: Aug 2004
Old 09-18-2004 , 21:53  
Reply With Quote #9

{ "nameofent", "classname", # of 3-unit vectors, 3 unit vectors (listed first), non-vector units }


Which was part of my post.
Anpheus is offline
meowmeow
Member
Join Date: Sep 2004
Old 11-05-2004 , 22:50  
Reply With Quote #10

Stupid question: How do you find out which version of AMXX you have ? I mean where do you go to check it if you don'e have the read me file that came with it.

Thanks for the help!
meowmeow is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 15:32.


Powered by vBulletin®
Copyright ©2000 - 2020, vBulletin Solutions, Inc.
Theme made by Freecode