I've been wondering this for a couple years now. So now I will ask, how does this work and can I reproduce it? I assume someone will say, its something to do with engine and not something I can do.
Code Snippet
Plaintext
trig waittill("trigger", player); //player becomes the player that triggered it self waittill( "damage", amount, attacker, directionVec, point, type ); //All of these vars are ?returned?
waittill is what I call a "special" function. It doesn't act like any normal function, whatever you put in as an argument actually becomes a defined variable. You can do
Code Snippet
Plaintext
ent notify( "string", trigger );
and somewhere else you can do
Code Snippet
Plaintext
ent waittill( "string", trigger );
and 'trigger' will automatically be a defined variable, defined as the trigger you passed on in the 'notify' in the other function. You don't even have to add
Code Snippet
Plaintext
trigger = undefined;
above it. It just works. This has proven super useful to me.
Last Edit: February 23, 2016, 10:43:41 pm by alaurenc9
No you cannot make your own. For something like that though, I would recommend using
Code Snippet
Plaintext
struct = SpawnStruct();
to have something to notify on and be saved as the 'trigger' in your system. For those who are unclear, structs do NOT cound towards g_spawn, you cannot even delete them.
No you cannot make your own. For something like that though, I would recommend using
Code Snippet
Plaintext
struct = SpawnStruct();
to have something to notify on and be saved as the 'trigger' in your system. For those who are unclear, structs do NOT cound towards g_spawn, you cannot even delete them.
Lol, yup, that is one of the methods, but I usually just use the ent itself. Okay, thanks for confirming that I can't reproduce it.