- Joined
- Nov 25, 2021
- Messages
- 507
So I have four static buildings, and a trigger running periodically that allows each of them to randomly teleport to one of the other three Locations. They also must not stay still, and must not teleport to an already occupied Location.
-
Init Unit
-
Events
-
Conditions
-
Actions
-
-------- Run after Map Initialization --------
-
Set BossUnit[1] = My Structure 1 <gen>
-
Set BossUnit[2] = My Structure 2 <gen>
-
Set BossUnit[3] = My Structure 3 <gen>
-
Set BossUnit[4] = My Structure 4 <gen>
-
-
-
Swap
-
Events
-
Time - Every 5.00 seconds of game time
-
-
Conditions
-
Actions
-
Custom script: local boolean array Occupied
-
For each (Integer A) from 1 to 4, do (Actions)
-
Loop - Actions
-
Unit - Hide BossUnit[(Integer A)]
-
Set BossPoint[(Integer A)] = (Position of BossUnit[(Integer A)])
-
-
-
For each (Integer A) from 1 to 4, do (Actions)
-
Loop - Actions
-
Custom script: loop
-
Custom script: exitwhen Occupied[udg_BossInt] == false and not(udg_BossInt == bj_forLoopAIndex )
-
Set BossInt = (Random integer number between 1 and 4)
-
Custom script: endloop
-
Custom script: set Occupied[udg_BossInt] = true
-
Unit - Move BossUnit[(Integer A)] instantly to BossPoint[BossInt]
-
Unit - Unhide BossUnit[(Integer A)]
-
-
-
-