for each integer from ... trigger help?

KingTobiazZz

New Member
Reaction score
1
For Each Integer
Variable: Amount Of Units In Training Group
Start: 1
End: 10
Increment: 1

how does this trigger work? I want an action to be done X times, where X is the variable [amount of units in training group]. But how should I do that exactly?
 

Cookiemaster

New Member
Reaction score
36
You need to make an integer variable to be looped.

Variable: <the int var you made>
start: <the lowest int value that it has to use, 1 by default>
end: <the highest int value that it should use, 10 by default>
increment: <how much the variable is increased by each loop>


Example:
var = <local integer variable i>
start = 3
end = 8
increment = 2

The actions within the loop will then be executed with variable "i" being equal to 3, then "i" being equal to 5 (3+2), then "i" being equal to 7 (5+2), and then the loop ends. (7+2=9>8, this no longer gets executed.)
 

KingTobiazZz

New Member
Reaction score
1
thx, I didnt understood where the veriable was used for.

For Each Integer
Variable: LocalCounter
Start: 1
End: Amount Of Units In Training Group
Increment: 1

this seems to work
 

ZugZugZealot

New Member
Reaction score
33
The other purpose for the iterator (the variable), is so you can make reference to the loop count. You could do a loop of 1 to 12, then have the actions "Create x units at SomePoint for Player i with (no options)" in the loop

If you don't want to bother with setting a variable to a loop, use "Pick Each Integer" loop.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top