• 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.

Help with trigger to determine player...

Status
Not open for further replies.
Level 4
Joined
Oct 28, 2007
Messages
72
Hi i need help. 8 players with 12 different units fight with each other and i need the trigger to check region if only 1 player (his last men standing unit/s) survived.Units are all target as ground, other non combat units are near for every player because they giving aura buff..Am gonna try periodicly lets say every 5 sec so if fight finish then my other trigger starts (picking again units and etc) If you need more info ask!
If anyone have idea please help..Thanks!
 
Level 18
Joined
Mar 7, 2005
Messages
824
I don't really get it, so you just want to check after the fight, which last unit survived and who it belongs to?

I would simply use a periodic pick all units on playable area (or whatever u like to) and first check if number of units > 1, if it's false it would mean there's just one unit left.. and then just re-check it.. if unit is owned by player 1 then do, else if unit is owned by player 2, bla bla bla.. something like that. I guess there might also be a trigger that makes this faster without checking all players, but I don't have the editor here right now..
 
Level 9
Joined
Jun 7, 2008
Messages
440
Why not use the event:
  • Events
    • Unit - A unit dies
This would be a little better, and more precise then doing a periodic check. You could also add each unit in each area to a unitgroup (array??). When a unit dies, check if there are any units in that particular group alive.

Following that, check the owner of the player and do what is needed.
 
Level 4
Joined
Oct 28, 2007
Messages
72
tnx for replay i already try all what you suggest
problem for 1 unit is that player have 12 units and sometimes survive more than 1 so i think deeper and come to solution that CrueIIntentions suggest which will work but trigger is to damn long because of units are diffrent so it hurt :D so i change whole story instead rounds to instant spawn set periodic so it wont crash that many units etc etc tnx for help this thread can be close.
 
Status
Not open for further replies.
Top