If you select a custom script page and look down at the very bottom, there should be a text field called something like "initialization function". This can be used to have a single function of type void() (no parameters) run right when the map starts.
Just put the name of the function in there. No need for the parantheses or semicolon.
It could be that you are defining DualKill() somewhere below the location of this trigger. Try moving the custom script that DualKill() is in above the trigger that is calling it - that might work.
Obviously I'll need a bit more information than that, haha. What does the script look like, how are you running the script, and what does the error say?
That will do what you want. Do note that i must be declared before and outside of the for loop. All declarations must be at the top of a function. Also, the last expression, incrementing/decrementing, does not accept i+ +, only i += 1, etc.
@Mugen245: Go
If you select a custom script page and look down at the very bottom, there should be a text field called something like "initialization function". This can be used to have a single function of type void() (no parameters) run right when the map starts.
Just put the name of the function in there. No need for the parantheses or semicolon.
@Mugen245: Go
I don't understand. What are you trying to do with this one?
@Mugen245: Go
It could be that you are defining DualKill() somewhere below the location of this trigger. Try moving the custom script that DualKill() is in above the trigger that is calling it - that might work.
@Mugen245: Go
Obviously I'll need a bit more information than that, haha. What does the script look like, how are you running the script, and what does the error say?
@Mugen245: Go
If the script you want to run is simply another function, like:
Then you can run it simply by calling the function, like so:
If you want to run it as a trigger, then the function must return a bool and accept two bool parameters, like:
Then you can execute it as a trigger by doing:
Alternatively you may add events to it, as with making triggers in the GUI:
@Mugen245: Go
More flexible means that you can do more things. The lowest level example would be dynamically creating triggers using TriggerCreate(string func).
The highest level example would be defining structs and passing those around using structrefs:
struct player { int num; string name; unit hero; }; typedef structref<player> player_r;
void doStuff(player_r p); typedef funcref<doStuff> doStuff_r;
etc. etc.
Being able to do more things, though, does not necessarily mean being faster.
@Mugen245: Go
That will do what you want. Do note that i must be declared before and outside of the for loop. All declarations must be at the top of a function. Also, the last expression, incrementing/decrementing, does not accept i+ +, only i += 1, etc.