- Joined
- Jul 18, 2010
- Messages
- 332
How do you make 2 loops(for each integer A) activate at the same time. They always don't work at the same time and I never knew how to fix it.
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Just use 1 global variable to run looping function.to fix this, you use variables for the integers, make two variable for each integer A you want to run :3
Loop 1

Events


Time - Every 1.00 seconds of game time

Conditions

Actions


For each (Integer LoopingInteger) from 1 to 5, do (Actions)



Loop - Actions




Game - Display to (All players) the text: Hello
Loop 2

Events


Time - Every 1.00 seconds of game time

Conditions

Actions


For each (Integer LoopingInteger) from 1 to 5, do (Actions)



Loop - Actions




Game - Display to (All players) the text: World
Melee Initialization

Events


Map initialization

Conditions

Actions


For each (Integer LoopingIntegerA) from 1 to 5, do (Actions)



Loop - Actions




Unit - Create 1 Footman for Player 1 (Red) at (Center of (Playable map area)) facing Default building facing degrees




Wait 1.00 seconds
Melee Initialization Copy

Events


Map initialization

Conditions

Actions


For each (Integer LoopingIntegerB) from 1 to 10, do (Actions)



Loop - Actions




Unit - Create 1 Peasant for Player 1 (Red) at (Center of (Playable map area)) facing Default building facing degrees




Wait 1.00 seconds
Melee Initialization Copy Copy

Events


Map initialization

Conditions

Actions


For each (Integer LoopingIntegerC) from 1 to 15, do (Actions)



Loop - Actions




Unit - Create 1 Knight for Player 1 (Red) at (Center of (Playable map area)) facing Default building facing degrees




Wait 1.00 seconds
What about my question? Would it work with different loop integers?
blabla

Events


Time - Every 1.00 seconds of game time

Conditions

Actions


Custom script: local integer i = udg_Last_Index + 1


Custom script: set udg_Last_Index = i


For each (Integer Integer[Last_Index]) from 1 to 10, do (Actions)



Loop - Actions




Wait 1.00 seconds




-------- do action --------


Custom script: set udg_Current_Index = i


Set Integer[Current_Index] = Integer[Last_Index]


Set Last_Index = (Last_Index - 1)
