well a lot of the actions are spawn units actions. but i donßt spawn just the same unit all the time, so i spawn every unit (or group not more than 8 units) with its own action. do you think i can save space when i use a periodic event and vary it with numbers a trigger is executed? you seem to be pretty versatile with the trigger editor, how would you do 35 different waves with variation within each wave.
Example: Banelings wave: first 8 zergs, 4 banelings, then again, then again, then agsain, then 15 zergs 8 banelings, again, 20 banelings.
thats how all my waves look like...
EDIT: create unit actions are only 500. 2800 set variables, 500 disallow abilities... oh i see, whats really using a lot space is my hero equipment dialog. 3 players, 6 heros, 20 items (= buttons) each.... damn
I'm going to answer the OP's question and only the OP's question as in the title.
Quote:
Is there a restriction for the number of triggers?
Technically speaking, yes. There is a 2MB script limit, and each trigger will use about 4 bytes of that. That leaves you with more triggers than you could ever have a use for. (Yes, over 9000.)
Technically speaking, yes. There is a 2MB script limit, and each trigger will use about 4 bytes of that. That leaves you with more triggers than you could ever have a use for. (Yes, over 9000.)
I noticed you have ZERO parameters in that trigger overview. If you are making action functions and have no parameters, you aren't really using them optimally. You probably can reduce the amount of code if you make a good action function that can do lots things at once using parameters.
Actually nvm, I just realized you might be using global variables to pass as parameters...
Remember that Action Definitions are often used as macros. Rather than doing the same set of triggers 50 times you can do it once and use that action definition to do it again.
can someone explain me how parameters work? i jsut watched the array and loop tutorial, so i know now what a for loop is ;), well i already used arrays of course...
i could reduce my code by 200 actions in 1 trigger i just realized i did that really stupid.
with the map init i disable all the hero abilities for all 3 players.
local variable (integer) = "player index"
set player index = 1
disable ability x for player "player index"
disable ... (about 80 abilities)
set player index = 2
disable ability x for player "player index"
disable ...
what do you think is the better: an action "pick up player and disable ability for picked player" or an action defintion with parameters (which i don´t know how to use atm)
a while loop of course, thought we did talk about that. never use for or for each in this editor
and here is and super simple and so pretty stupid example for functions with parameter. it is only worth it, if the spawn trigger gets complex enough. for example a while loop to spawn x single units at x random points and not 5 at one point. they can be used for a lot of things you use very often in your map with only small differences in the variables. or even add some if then inside the function.
ok, i optimized my triggers and voila i saves 4 MB uncompressed space :-D
lesson to learn: keep your triggers clean from the beginning, you never know how much you will need later.
ATTACHMENTS
TLS_Space_Use_2.jpg
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
@PsychoMC: Go
Use arrays where you need them. No difference between arrays and single variables.
And uhh, I just gathered my knowledge over time.
@b0ne123: Go
well a lot of the actions are spawn units actions. but i donßt spawn just the same unit all the time, so i spawn every unit (or group not more than 8 units) with its own action. do you think i can save space when i use a periodic event and vary it with numbers a trigger is executed? you seem to be pretty versatile with the trigger editor, how would you do 35 different waves with variation within each wave.
Example: Banelings wave: first 8 zergs, 4 banelings, then again, then again, then agsain, then 15 zergs 8 banelings, again, 20 banelings.
thats how all my waves look like...
EDIT: create unit actions are only 500. 2800 set variables, 500 disallow abilities... oh i see, whats really using a lot space is my hero equipment dialog. 3 players, 6 heros, 20 items (= buttons) each.... damn
Have you looked into records? could be the saving grace of your mod.
I realized too late as well these limitations and my game crash and burned :(
income wars ^^
i really want to take a look at your code. optimizing is fun. send me a pm if you want to
I'm going to answer the OP's question and only the OP's question as in the title.
Technically speaking, yes. There is a 2MB script limit, and each trigger will use about 4 bytes of that. That leaves you with more triggers than you could ever have a use for. (Yes, over 9000.)
DO NOT CONFUSE THIS WITH THE SCRIPT FILE SIZE.
there is a screen, he made it ;)
sorry, i reached the limit and i need more :-D
@sandround: Go
Remember that Action Definitions are often used as macros. Rather than doing the same set of triggers 50 times you can do it once and use that action definition to do it again.
can someone explain me how parameters work? i jsut watched the array and loop tutorial, so i know now what a for loop is ;), well i already used arrays of course...
i could reduce my code by 200 actions in 1 trigger i just realized i did that really stupid.
with the map init i disable all the hero abilities for all 3 players.
local variable (integer) = "player index"
set player index = 1
disable ability x for player "player index"
disable ... (about 80 abilities)
set player index = 2
disable ability x for player "player index"
disable ...
what do you think is the better: an action "pick up player and disable ability for picked player" or an action defintion with parameters (which i don´t know how to use atm)
doing three times the same stuff but only once, screams for a loop^^
true... but which one ;)
a while loop of course, thought we did talk about that. never use for or for each in this editor
and here is and super simple and so pretty stupid example for functions with parameter. it is only worth it, if the spawn trigger gets complex enough. for example a while loop to spawn x single units at x random points and not 5 at one point. they can be used for a lot of things you use very often in your map with only small differences in the variables. or even add some if then inside the function.
ok, i optimized my triggers and voila i saves 4 MB uncompressed space :-D lesson to learn: keep your triggers clean from the beginning, you never know how much you will need later.