I am spawning a small ambush that is triggered when a players units enter a region.
The problem is that zerglings just keep on spawning as if the actions are running over and over again.
I tried a function and a trigger both with the same result. I'm going to train myself up on functions today because they seem to save time but it seems that the problem here is having the event as "unit enters region". I have tried using the 'stop trigger' function and using variables to halt the trigger but to no avail.
What I want is to spawn some lings when a player unit enters a region, have those lings attack, place a pathing blocker where they emerged. what am I doing wrong?
I posted some pics but I think the mods removed them because I'm such a noob and my pikchars are broked so here is the trigger.
Events - [any unit] enters [ambush1(region)]
IF - [active players] = 1
THEN - create [5] [zergling] at [ambush spawn(point)]
- order [last created units] to [attack] targeting [start units(unit group)]
- wait [4] [game time] seconds
- create [1] [dynamic pathing blocker] at [ambush1blocker(point)]
ELSE - IF - [active players] = 2
THEN - create [10] [zergling] at .....etc
I have tried with only one 'creat units' action enabled and no 'if then else' the problem still occurs.
You say zerglins keep spawning? Aren't those zerglings triggering the trigger again? So you should exclude that with a condition. Also if you want it to happen only once, run the trigger off action. Something like this works for me:
This is a three player map so the triggering unit could be any one of 6 unit typed from three different players. I cannot see an condition for triggering player to be *any player* from player group 'active players' (it has to be one player from active players), so I have made the condition to be "NOT - triggering player == 5" (player 5 being the owner of the zerglings)
I have also added the turn trigger off function, the problem still occurs. Perhaps I should be doing this a completely different way?
SOLVED* It seems that the problem was the 4 second wait in between the unit spawn and the pathing blocker spawn, AFTER which came the turn trigger off action. I seperated the wait and the blocker spawn to a different trigger, run at the start of the ambush trigger and it works. Thank's nexius.
I am spawning a small ambush that is triggered when a players units enter a region. The problem is that zerglings just keep on spawning as if the actions are running over and over again.
I tried a function and a trigger both with the same result. I'm going to train myself up on functions today because they seem to save time but it seems that the problem here is having the event as "unit enters region". I have tried using the 'stop trigger' function and using variables to halt the trigger but to no avail.
What I want is to spawn some lings when a player unit enters a region, have those lings attack, place a pathing blocker where they emerged. what am I doing wrong?
I posted some pics but I think the mods removed them because I'm such a noob and my pikchars are broked so here is the trigger.
Events - [any unit] enters [ambush1(region)]
IF - [active players] = 1 THEN - create [5] [zergling] at [ambush spawn(point)] - order [last created units] to [attack] targeting [start units(unit group)] - wait [4] [game time] seconds - create [1] [dynamic pathing blocker] at [ambush1blocker(point)] ELSE - IF - [active players] = 2 THEN - create [10] [zergling] at .....etc
I have tried with only one 'creat units' action enabled and no 'if then else' the problem still occurs.
You say zerglins keep spawning? Aren't those zerglings triggering the trigger again? So you should exclude that with a condition. Also if you want it to happen only once, run the trigger off action. Something like this works for me:
@nexius22: Go
This is a three player map so the triggering unit could be any one of 6 unit typed from three different players. I cannot see an condition for triggering player to be *any player* from player group 'active players' (it has to be one player from active players), so I have made the condition to be "NOT - triggering player == 5" (player 5 being the owner of the zerglings)
I have also added the turn trigger off function, the problem still occurs. Perhaps I should be doing this a completely different way?
SOLVED* It seems that the problem was the 4 second wait in between the unit spawn and the pathing blocker spawn, AFTER which came the turn trigger off action. I seperated the wait and the blocker spawn to a different trigger, run at the start of the ambush trigger and it works. Thank's nexius.