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.
IF ever id use a Number of Players in Player Group, What would the Script look like, is it still IntegerVar < 5 ? (5 Players)
Im pretty sure that the reason of lag in your map is not that you are using GUI.
In fact, code created by GUI and custom script pretty much have the same performance in most scenarios.
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?
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Whats the Custom Script for For Each Integer?
@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.
Huge thanks mate, Been working around with Custom Scripts lately and bump upon this problem. Thanks.
btw whats with the Integer IsGreaterThan5 was it Integer 1-5 (Sorry Noobie here)
its a for loop, it picks each integer from 1-5 to doStuff();
@SoulTaker916: Go
Alright thanks, With an Incrementing of +1 ^^
May i ask why you need custom script?
@Mille25: Go
So that the game wont lag.
@SoulTaker916: Go
IF ever id use a Number of Players in Player Group, What would the Script look like, is it still IntegerVar < 5 ? (5 Players)
Im pretty sure that the reason of lag in your map is not that you are using GUI.
In fact, code created by GUI and custom script pretty much have the same performance in most scenarios.
@Mille25: Go
Whats causing it then? They said its more flexible to use GUI Scripting rather than normal trigger coding.
@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
to answer your first question
notice i changed it to 15?
to answer the second question. theres a trigger debug you can use to gage the efficiency and lag spikes of all your triggers.
@SoulTaker916: Go
yea.
and what Trigger is it btw? :)
its in the editor preferences. the sc2 must be windowed for it to work
Alright where can I find that? :D
@Mugen245: Go
File >> preferences >> test document >> show trigger debugging window.
@DeltaV: Go
A question though whats the Custom Script to Run Another Custom Script, Since Trigger; is like a Variable.... for me I checked SotIS btw.
I dont know, i would need more information for making a guess.
@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:
Somehow it gives me an Error while calling out the Script, Is there any other way around that?
@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?