I have a problem in which the creeps spawn by a loop and i need the collision of the units off. I have set their collision to 0 but they still run into one another. If I add a trigger to the second one with the collision off command it lags the game horribly. Thats why its at the end after all the spawning. I have the trigger to turn off the collision when the loop is done, but it needs to be before so they don't collide while the loop is still running. I tried to use the following trigger to turn off collision on the units before they are spawned but there was no success.
I think i need to be able to specify a range for the array for this to work,but i'm not sure how or even if it will work.
I cannot add the collision off command inside the loop here or it lags the game bad until all the creeps are spawned.
Any help would be greatly appreciated!
I think i need to be able to specify a range for the array for this to work,but i'm not sure how or even if it will work.
Trigger:
- Collision
- Events
- Map initialization
- Conditions
- Actions
- Set TempGroup = (Units of type creepArray[(LVL)])
- Unit Group - Pick every unit in TempGroup and do (Unit - Turn collision for (Triggering unit) Off)
- Events
I cannot add the collision off command inside the loop here or it lags the game bad until all the creeps are spawned.
Trigger:
- Spawn Creeps
- Events
- Time - Counter expires
- Conditions
- Actions
- Countdown Timer - Destroy (Last created timer window)
- For each (Integer A) from 1 to creepSpawnCount[LVL], do (Actions)
- Loop - Actions
- Wait 0.00 seconds
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Player 6 (Orange) slot status) Equal to Is playing
- Then - Actions
- Set OrangeSpawn = (Center of Orange Spawn <gen>)
- Unit - Create 1 creepArray[LVL] for Player 12 (Brown) at OrangeSpawn facing 0.00 degrees
- Custom script: call RemoveLocation(udg_OrangeSpawn)
- Else - Actions
- Do nothing
- If - Conditions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Player 7 (Green) slot status) Equal to Is playing
- Then - Actions
- Set GreenSpawn = (Center of Green Spawn <gen>)
- Unit - Create 1 creepArray[LVL] for Player 12 (Brown) at GreenSpawn facing 0.00 degrees
- Custom script: call RemoveLocation(udg_GreenSpawn)
- Else - Actions
- Do nothing
- If - Conditions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Player 9 (Gray) slot status) Equal to Is playing
- Then - Actions
- Set GreySpawn = (Center of Gray Spawn <gen>)
- Unit - Create 1 creepArray[LVL] for Player 12 (Brown) at GreySpawn facing 0.00 degrees
- Custom script: call RemoveLocation(udg_GreySpawn)
- Else - Actions
- Do nothing
- If - Conditions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Player 8 (Pink) slot status) Equal to Is playing
- Then - Actions
- Set PinkSpawn = (Center of Pink Spawn <gen>)
- Unit - Create 1 creepArray[LVL] for Player 12 (Brown) at PinkSpawn facing 0.00 degrees
- Custom script: call RemoveLocation(udg_PinkSpawn)
- Else - Actions
- Do nothing
- If - Conditions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Player 1 (Red) slot status) Equal to Is playing
- Then - Actions
- Set RedSpawnA = (Center of Red Spawn A <gen>)
- Unit - Create 1 creepArray[LVL] for Player 12 (Brown) at RedSpawnA facing 0.00 degrees
- Custom script: call RemoveLocation(udg_RedSpawnA)
- Set RedSpawnA = (Center of Red Spawn B <gen>)
- Unit - Create 1 creepArray[LVL] for Player 12 (Brown) at RedSpawnB facing 0.00 degrees
- Custom script: call RemoveLocation(udg_RedSpawnB)
- Else - Actions
- Do nothing
- If - Conditions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Player 5 (Yellow) slot status) Equal to Is playing
- Then - Actions
- Set YellowSpawn = (Center of Yellow Spawn <gen>)
- Unit - Create 1 creepArray[LVL] for Player 12 (Brown) at YellowSpawn facing 0.00 degrees
- Custom script: call RemoveLocation(udg_YellowSpawn)
- Else - Actions
- Do nothing
- If - Conditions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Player 4 (Purple) slot status) Equal to Is playing
- Then - Actions
- Set PurpleSpawn = (Center of Purple Spawn <gen>)
- Unit - Create 1 creepArray[LVL] for Player 12 (Brown) at PurpleSpawn facing 0.00 degrees
- Custom script: call RemoveLocation(udg_PurpleSpawn)
- Else - Actions
- Do nothing
- If - Conditions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Player 2 (Blue) slot status) Equal to Is playing
- Then - Actions
- Set BlueSpawn = (Center of Blue Spawn <gen>)
- Unit - Create 1 creepArray[LVL] for Player 12 (Brown) at BlueSpawn facing 0.00 degrees
- Custom script: call RemoveLocation(udg_BlueSpawn)
- Else - Actions
- Do nothing
- If - Conditions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Player 3 (Teal) slot status) Equal to Is playing
- Then - Actions
- Set TealSpawn = (Center of Teal Spawn <gen>)
- Unit - Create 1 creepArray[LVL] for Player 12 (Brown) at TealSpawn facing 0.00 degrees
- Custom script: call RemoveLocation(udg_TealSpawn)
- Else - Actions
- Do nothing
- If - Conditions
- Loop - Actions
- Player Group - Pick every player in (All players) and do (Unit Group - Pick every unit in (Units in (Playable map area) owned by Player 12 (Brown)) and do (Unit - Turn collision for (Picked unit) Off))
- Countdown Timer - Destroy (Last created timer window)
- Countdown Timer - Start Counter as a One-shot timer that will expire in 10.00 seconds
- Countdown Timer - Create a timer window for Counter with title Next wave in
- Events
Any help would be greatly appreciated!