• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

trigger end when a certian force(group) leave region

Status
Not open for further replies.

stu

stu

Level 3
Joined
May 11, 2005
Messages
23
Okay, now, thanks to the help from kind folks on these forums, my creep waves are almost done

Okay, first i have a trigger that happens when one of the players units enter a region, that starts the Time Elsape Trigger that makes the creeps. (and the seprate trigger to make them run)... however after testing the map i ran into a big issue. (kind of a no brainer, but amazing what you dont think of huh?) Naturally it doesnt turn off, which means that if you battle then retreat to heal you come back to a hord.

How can i turn the trigger off? i now there is an action to do that, but how can i set it to turn off only if ALL players have left the region (as opposed to Unit-Leave Area, which would trigger all the time) (note* number of players is dynamic)

Thx for you time
 
Level 2
Joined
Jun 28, 2004
Messages
7
This is how I would disable the spawing. This trigger will require you to create a variable that will be the number of players in the region, I titled this variable Players_in_region.


*TITLE OF TRIGGER*
Events
Unit - A unit leaves (*INSERT REGION HERE*)
Conditions
(Owner of (Triggering unit)) Not equal to *INSERT ENEMY PLAYER HERE*
Actions
Set Players_in_reigon = (Players_in_reigon - 1)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Players_in_reigon Less than or equal to 0
Then - Actions
Trigger - Turn off (*INSERT NAME OF SPAWN TRIGGER HERE*)
Else - Actions


You will also have add the following to your spawn enable trigger.
Set Player_in_region = (Players_in_region + 1)

If this does not work let me know.
 
Level 10
Joined
Aug 28, 2004
Messages
485
Isn't it more simple just to do this :
Events
A unit leaves (your region)
Conditions
((Triggering unit) belongs to an enemy of Player1(Red)) Equal to True <-- instead of Player1 Red u will put the color off the spawned units.
Actions
Turn off this trigger
 
Level 2
Joined
Jun 28, 2004
Messages
7
stu said:
...how can i set it to turn off only if ALL players have left the region...

eXciTe as you have yours set up the spawn would turn off every time a unit that is not owned by the enemy would leave the region, not when all players have left the region.
 

stu

stu

Level 3
Joined
May 11, 2005
Messages
23
Problem... this build has a glitch... you see what if a unit dies in the region?

perhpas im tackling this the wrong way... this there a way to check the region for the number of units Player (brown in this case) owns.... and destory them if there are two many?

any effect that makes it so that if you go to heal you dont come back to an army would work...any ideas?
 
Level 13
Joined
May 5, 2004
Messages
1,330
Events
Unit - A unit leaves [Region]
Conditions
(Owner of (Leaving unit)) Not Equal To [Enemy]
Actions
If ((Number of units in (Units in [Region] matching (((Owner of (Matching unit)) Not Equal To [Enemy]) and (((Matching unit) is alive) Equal To True)))) Equal To 0) then do (Trigger - Turn off [Spawn Trigger]) else do (Do nothing)

I guess that could still be a problem if the last player that's in the region dies. Didn't test, so as precaucion you could use the same trigger with different Event/condition:

Events
Unit - A unit dies
Conditions
(Owner of (Dying Unit)) Not Equal To [Enemy]
Actions
Same as above


I guess that's not the best solution, but for further help I would need to see your complete spawn system.
 
Status
Not open for further replies.
Top