- Joined
- Apr 5, 2008
- Messages
- 10
READ THE WHOLE POST. THIS IS NOT AS SIMPLE AS SPAWNING A UNIT IN RANDOM REGION.
I would like to make a trigger that spawns a Unit A in a random region every X seconds (The unit is unable to move). I would like units to stop spawning in the region when the amount of Unit A's in it = 1. When number of Unit A's in region = 0, I want units to start spawning in the region.
This is what I've done - which doesn't work
Problem: When the game starts, every X seconds a Unit A is spawned in a random region until all regions have one Unit A. Unit B (which is controlled by player) moves around the map killing Unit A's. After Unit A is killed, another Unit A will never re-spawn in it's place even though (Number of units in (Units in ItemSpawn <gen>)) Equal to 0.
I would like to make a trigger that spawns a Unit A in a random region every X seconds (The unit is unable to move). I would like units to stop spawning in the region when the amount of Unit A's in it = 1. When number of Unit A's in region = 0, I want units to start spawning in the region.
This is what I've done - which doesn't work
- Events
- Time - Every X seconds of game time
- Conditions
- Actions
- Set ItemChances = (Random Real number between 0.00 and 4.00)
- If (All Conditions are True) then do (Then Actions) Else do (Else Actions)
- If - Conditions
- (Number of units in (Units in ItemSpawn1 <gen>)) Equal to 0
- ItemChances Less that or equal to 1.00
- Then - Actions
- Unit - Create 1 Unit A for Player 9 (Gray) at (Center of ItemSpawn1 <gen>) facing Default building facing degrees
- Else - Actions
- If (All Conditions are True) then do (Then Actions) Else do (Else Actions)
- If - Conditions
- (Number of units in (Units in ItemSpawn2 <gen>)) Equal to 0
- ItemChances Less that or equal to 2.00
- Then - Actions
- Unit - Create 1 Unit A for Player 9 (Gray) at (Center of ItemSpawn2 <gen>) facing Default building facing degrees
- Else - Actions
Problem: When the game starts, every X seconds a Unit A is spawned in a random region until all regions have one Unit A. Unit B (which is controlled by player) moves around the map killing Unit A's. After Unit A is killed, another Unit A will never re-spawn in it's place even though (Number of units in (Units in ItemSpawn <gen>)) Equal to 0.
Last edited: