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

Victory trigger

Status
Not open for further replies.
Level 2
Joined
Jul 27, 2006
Messages
7
Hi


I need some help to do a victory trigger to my map:

when all players are defeated except 1 make the 1 left victory

I kow it should be easy but I can't figure it out =S
 
Level 16
Joined
Oct 30, 2004
Messages
1,277
When a player leaves pick all players matching condition is still playing. Then check if its only one player matching the condition and set him victory. Dont have the time to open editor atm. That should atleast guide you to right direction.
 
Heres what you do. Create a variable for each player setting [use a boolean variable] when a player leaves/is deffeated/isnt there period make it set that variable to false. then create a trigger that runs every so often [might need a few of these] so that when all but one player's staus is 'here equal to false' the remaining player wins
 
Level 16
Joined
Oct 30, 2004
Messages
1,277
This should work, though havent tested it, whipped it up in couple of secs (player_count is a integer variable default 0):

  • leaver
    • Events
      • Player - Player 1 (Red) leaves the game
      • Player - Player 2 (Blue) leaves the game
      • Player - Player 3 (Teal) leaves the game
      • Player - Player 4 (Purple) leaves the game
      • Player - Player 5 (Yellow) leaves the game
    • Conditions
    • Actions
      • Player Group - Pick every player in (All players matching (((Matching player) slot status) Equal to Is playing)) and do (Actions)
        • Loop - Actions
          • Set player_count = (player_count + 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • player_count Equal to 1
        • Then - Actions
          • Player Group - Pick every player in (All players) and do (Game - Victory (Picked player) (Show dialogs, Show scores))
        • Else - Actions
          • Set player_count = 0
 
Status
Not open for further replies.
Top