minikrampan
Ultra Cool Member
- Reaction score
- 28
As usual I lack the ability to make good headlines. Anyway, I'ts like a minigame and i hate minigames where you always spawn at the same place, so i was gonna do this randomly. And heres what I got
The problem is that all units doesn't spawn. It trigger checks everytime it's about to spawn a unit if a unit already is there, and if it is it won't spawn anything. So how can I add a condition to spawn somewhere else if theres already a unit where the new unit is supposed to spawn?
ps. I also lack the ability of explaining myself in understandable ways.
Trigger:
- unit place
- Events
- Time - Elapsed game time is 0.01 seconds
- Conditions
- Actions
- For each (Integer A) from 1 to 12, do (Actions)
- Loop - Actions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- ((Player((Integer A))) slot status) Equal to Is playing
- Then - Actions
- Set start_int = (Random integer number between 1 and 12)
- Set temp_point = (Center of Spawns[start_int])
- Set temp_group = (Units in Spawns[start_int])
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Number of units in temp_group) Equal to 0
- Then - Actions
- Unit - Create 1 Unit for (Player((Integer A))) at temp_point facing Default building facing (270.0) degrees
- Else - Actions
- If - Conditions
- Custom script: call RemoveLocation(udg_temp_point)
- Custom script: call DestroyGroup(udg_temp_group)
- Else - Actions
- If - Conditions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Loop - Actions
- For each (Integer A) from 1 to 12, do (Actions)
- Events
The problem is that all units doesn't spawn. It trigger checks everytime it's about to spawn a unit if a unit already is there, and if it is it won't spawn anything. So how can I add a condition to spawn somewhere else if theres already a unit where the new unit is supposed to spawn?
ps. I also lack the ability of explaining myself in understandable ways.