Guest3z
New Member
- Reaction score
- 22
Ok so I wanted to make a map where wisps would spawn and circle in a wheel and as time went on it gets harder and harder. I made a trigger to do all the spawning for me all I would need to do is set the level before I ran the trigger. Here it is
I use TempGroup to move the wisps in another trigger and every time it loops around (360°) It runs this trigger so you have to move to dodge the wisps again. Level is an integer set before I run this so It's not that, but the problem is whenever I run this It doesn't spawn the right amount of wisps and I can't figure out why. I just want it to spawn the level integer in wisps, so level 1 would have 1 wisp and 2 would have 2 and so on. For some reason It seems to make any amount of wisps it feels like. I think the red line is the problem but I just don't get it. Please help +rep
Btw I posted the map so you can try yourself and see what happens if you feel like it http://www.epicwar.com/maps/download/29224/Asdfjklol.w3x
-Edit Fixed it... it seems unit groups cannot update instantly because when I added a wait 0.00 seconds trigger at the start of the loop
it magicly worked... but now it takes about a quarter of a second to delete all of the wisps. Oh well maybe this will help someone else.
Code:
SpawnWisps
Events
Conditions
Actions
Unit Group - Pick every unit in TempGroup and do (Unit - Remove (Picked unit) from the game)
Custom script: call DestroyGroup( udg_TempGroup )
For each (Integer A) from 1 to 9, do (Actions)
Loop - Actions
Set TempPt1 = (Center of WispRegion[(Integer A)])
Unit - Create 1 Wisp for Neutral Hostile at TempPt1 facing Default building facing degrees
Custom script: call RemoveLocation( udg_TempPt1 )
Set TempGroup = (Units owned by Neutral Hostile)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Level Greater than or equal to 9
Then - Actions
Unit - Remove (Random unit from TempGroup) from the game
Else - Actions
[COLOR="Red"]For each (Integer A) from 1 to (9 - Level), do (Actions)[/COLOR]
Loop - Actions
Unit - Remove (Random unit from TempGroup) from the game
Custom script: call DestroyGroup( udg_TempGroup )
Set TempGroup = (Units owned by Neutral Hostile)
Custom script: call DestroyGroup( udg_TempGroup )
Set TempGroup = (Units owned by Neutral Hostile)
Btw I posted the map so you can try yourself and see what happens if you feel like it http://www.epicwar.com/maps/download/29224/Asdfjklol.w3x
-Edit Fixed it... it seems unit groups cannot update instantly because when I added a wait 0.00 seconds trigger at the start of the loop
Code:
For each (Integer A) from 1 to (9 - Level), do (Actions)
Loop - Actions
Unit - Remove (Random unit from TempGroup) from the game
Custom script: call DestroyGroup( udg_TempGroup )
Set TempGroup = (Units owned by Neutral Hostile)