Evening. I managed to run into a really silly problem. On my map I have a trigger that spawns one unit of a unit type specified in a variable at each of 20 points (4 points per player), sets their health (from another variable) and adds them to a unit group. Now, I'd like one unit to spawn at each of the 20 points, then the trigger should wait about 1 second before it spawns four more - repeating until the amount of units hit the correct mark (6 units / point).
But for some reason, my trigger will spawn 1 unit on each point, then 4 units on each point, and then 1 more units on each point. Why!?
(The trigger's fired by another trigger, hence no Event. The Player Check variable is just to make sure spawns won't happen if the player those spawns are meant for isn't playing: 1-4 = player 1, 5-8 = player 2 etc.)
SpawnWavesEventsLocalVariablesConditionsWaveSpawnCount<NumberofUnitsPerPointPerWaveActionsGeneral-Wait1.0RealTimesecondsVariable-ModifyWaveSpawnCount:+1General-Pickeachintegerfrom1to20,anddo(Actions)ActionsGeneral-If(Conditions)thendo(Actions)elsedo(Actions)IfPlayerCheck[(Pickedinteger)]==1ThenUnit-Create1WaveUnits[WaveNumber]forplayer7atPlayerCheckPoints[(Pickedinteger)]usingdefaultfacing(NoOptions)Unit-Set(Lastcreatedunit)MaximumLifeto(Real(WaveHealth[WaveNumber]))UnitGroup-Add(Lastcreatedunit)toWaveUnitGroupTrigger-RunSpawnWaves(CheckConditions,Don't Wait until it finishes)Else
Well, you only supplied one trigger, but I'd say your Player Check Points function (or something associated with it) it wrong.
Edit: And what Pawl said - I didn't notice what trigger you ran there. Especially with a global variable in the two check functions this'll screw up a lot.
Well, you run "Spawn Waves" inside "Spawn Waves" 0-20 times every time you run it. It seems like that could drasticly increase the number of units you spawn very quickly.
If you just want the action to repeat you could use a while instead, or atleast put the "Trigger - Run" outside the loop.
Evening. I managed to run into a really silly problem. On my map I have a trigger that spawns one unit of a unit type specified in a variable at each of 20 points (4 points per player), sets their health (from another variable) and adds them to a unit group. Now, I'd like one unit to spawn at each of the 20 points, then the trigger should wait about 1 second before it spawns four more - repeating until the amount of units hit the correct mark (6 units / point).
But for some reason, my trigger will spawn 1 unit on each point, then 4 units on each point, and then 1 more units on each point. Why!?
(The trigger's fired by another trigger, hence no Event. The Player Check variable is just to make sure spawns won't happen if the player those spawns are meant for isn't playing: 1-4 = player 1, 5-8 = player 2 etc.)
What did I do wrong? :<
@Zinatic: Go
Well, you only supplied one trigger, but I'd say your Player Check Points function (or something associated with it) it wrong.
Edit: And what Pawl said - I didn't notice what trigger you ran there. Especially with a global variable in the two check functions this'll screw up a lot.
Well, you run "Spawn Waves" inside "Spawn Waves" 0-20 times every time you run it. It seems like that could drasticly increase the number of units you spawn very quickly.
If you just want the action to repeat you could use a while instead, or atleast put the "Trigger - Run" outside the loop.
@s3rius: Go
Wow, that was one messed up trigger. I rewrote it, but the problem remains. :/
@ItsPawl: Go
I'll try that.
Edit: That did the trick! Lesson learned. Thanks to both of you.