- Joined
- Nov 10, 2019
- Messages
- 14
Hi, I've been trying to move spawned units from one region to the next region, through a for each loop.
it doesn't seem to work since the unit stops at "T1 03 move2".
I kinda figured out my looping is wrong, but I can't figure out how to do it properly.
What I wanted was to get a "short" trigger that would do the job.
I have another trigger which creates the units, 1 every second for 10 seconds.
Regions are place in an array variable and has been indexed below.
regards the nooblet.
it doesn't seem to work since the unit stops at "T1 03 move2".
I kinda figured out my looping is wrong, but I can't figure out how to do it properly.
What I wanted was to get a "short" trigger that would do the job.
I have another trigger which creates the units, 1 every second for 10 seconds.
Regions are place in an array variable and has been indexed below.
-
regions
-
Events
- Map initialization
- Conditions
-
Actions
- Set regions[0] = T1 01 spawn <gen>
- Set regions[1] = T1 02 move1 <gen>
- Set regions[2] = T1 03 move2 <gen>
- Set regions[3] = T1 04 move3 <gen>
- Set regions[4] = T1 05 move4 <gen>
- Set regions[5] = T1 06 move5 <gen>
- Set regions[6] = T1 07 move6 <gen>
- Set regions[7] = T1 08 move7 <gen>
- Set regions[8] = T1 09 move8 <gen>
- Set regions[9] = T1 10 move9 <gen>
- Set regions[10] = T1 11 endmove <gen>
- Set regions[11] = T1 12 spawn battle <gen>
- Set regions[12] = T1 13 battle position <gen>
-
Events
-
Untitled Trigger 001
-
Events
- Unit - A unit enters T1 01 spawn <gen>
- Unit - A unit enters T1 02 move1 <gen>
- Unit - A unit enters T1 03 move2 <gen>
- Unit - A unit enters T1 04 move3 <gen>
- Unit - A unit enters T1 05 move4 <gen>
- Unit - A unit enters T1 06 move5 <gen>
- Unit - A unit enters T1 07 move6 <gen>
- Unit - A unit enters T1 08 move7 <gen>
- Unit - A unit enters T1 09 move8 <gen>
- Unit - A unit enters T1 10 move9 <gen>
- Unit - A unit enters T1 11 endmove <gen>
- Unit - A unit enters T1 12 spawn battle <gen>
- Unit - A unit enters T1 13 battle position <gen>
- Conditions
-
Actions
-
For each (Integer A) from 0 to 10, do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (regions[(Integer A)] contains (Entering unit)) Equal to True
-
Then - Actions
- Unit - Order (Entering unit) to Move To (Center of regions[((Integer A) + 1)])
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Loop - Actions
-
For each (Integer A) from 0 to 10, do (Actions)
-
Events
regards the nooblet.