- Joined
- Sep 10, 2006
- Messages
- 185
I'm trying to make a trigger that will switch the type of building units in this group are every 20 seconds.
This first trigger adds the unit to the group and randomizes the building for the first time...
(variable names are filler atm)
EDIT: Hmm, I think I got it working...
This first trigger adds the unit to the group and randomizes the building for the first time...
-
Primary Built
-
Events
- Unit - A unit Finishes construction
-
Conditions
- (Unit-type of (Constructed structure)) Equal to High Elven Farm 5
-
Actions
- Unit Group - Add (Constructed structure) to Unitgroup1
- Set Int1 = (Random integer number between 1 and 1)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- Int1 Equal to 1
-
Then - Actions
- Set Position1 = (Position of (Constructed structure))
- Unit - Remove (Constructed structure) from the game
- Unit - Create 1 Enhanced Guard Tower (1) for (Owner of (Constructed structure)) at Position1 facing Default building facing degrees
- Set Unit1[(Number of units in Unitgroup1)] = (Last created unit)
- Else - Actions
-
If - Conditions
-
Events
-
Primary Shuffle
-
Events
- Time - Every 20.00 seconds of game time
- Conditions
-
Actions
- Game - Display to (All players) the text: hello
-
For each (Integer A) from 1 to (Number of units in Unitgroup1), do (Actions)
-
Loop - Actions
- Set Int1 = (Random integer number between 1 and 2)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- Int1 Equal to 1
-
Then - Actions
- Set Position1 = (Position of Unit1[(Integer A)])
- Unit - Remove Unit1[(Integer A)] from the game
- Unit - Create 1 |c00ffff80Lightning Rod (1) for (Owner of Unit1[(Integer A)]) at Position1 facing Default building facing degrees
- Set Unit1[(Integer A)] = (Last created unit)
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- Int1 Equal to 2
-
Then - Actions
- Set Position1 = (Position of Unit1[(Integer A)])
- Unit - Remove Unit1[(Integer A)] from the game
- Unit - Create 1 |c0080ff80Envenomed Spike (1) for (Owner of Unit1[(Integer A)]) at Position1 facing Default building facing degrees
- Set Unit1[(Integer A)] = (Last created unit)
- Else - Actions
-
If - Conditions
-
Loop - Actions
-
Events
(variable names are filler atm)
EDIT: Hmm, I think I got it working...
Last edited: