• 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] Need help with a victory trigger

Status
Not open for further replies.
Level 3
Joined
Apr 4, 2010
Messages
14
Hi,
I really need some help with this trigger,
because I just cant seem to get it working.
I'm currently working on a map,
that uses a simple life system
(your hero dies -> you lose 1 life -> your life reaches 0 = defeat...)
I'm currently using a leather board to define the number of lives.
My map can be played with 6 players max.

My question is:
If 5 players get defeated, due to loosing all their lives will player 6 automatically win?
Or must I write an extra trigger for that??
And if I have to write an extra win trigger,
how do I tell the trigger to give victory to the last
player with any lives left?
Any help will be appreciated,

M.v.L
 
  • Trigger
  • Events
    • Map Initialization
  • Conditions
  • Actions
    • Set Temp_Force = (All players matching ((Matching player) slot status Equal to Is playing) and ((Matching player) controller Equal to User)
    • Set PlayerCount = (Number of players in Temp_Force)
    • Custom script: call DestroyForce (udg_Temp_Force) = optional.
  • Trigger1
  • Events
    • Unit - A unit dies
  • Conditions
  • Actions
    • Game - Defeat (Owner of (Triggering unit))
    • Set HeroCount = (HeroCount + 1)
    • If (All conditions are true) then do (Actions) else do (Actions)
      • If - Conditions
        • (HeroCount) Equal to (PlayerCount - 1)
      • Then - Actions
        • Player Group - Pick every player in (All players matching ((Matching player) slot status Equal to Is playing) and ((Matching player) controller Equal to User) and do (Actions)
          • Loop - Actions
            • Player - Victory (Picked player)
You can do something like this.
Temp_Force is a Player Group variable.
PlayerCount and HeroCount are Integer variables.
 
Status
Not open for further replies.
Top