• 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] Victory/Defeat Conditions

Status
Not open for further replies.
Hi, I have a question.

I want to make a victory/defeat condition, for a map with custom races.

Before the game starts, the players can choose their teams (team 1, team 2, team 3, ... ,) There are max 6 players, so there can be max 6 teams.

And my question is, how can I trigger a victory/defeat (when for example only team 1 is alive, that this team win) condition?

I've tried it many times, and even with the normal Victory/Defeat conditions, but nothing works.

Maybe someone of you know how to solve this problem.
 
Level 12
Joined
May 4, 2008
Messages
1,111
hmmmm make a trigger that if a player is defeated it get sent to his team's "lost" playergroup and when all players of that team are in it, it checks if 2 or more teams are alive then if onyl 1 is alive, it gives victory to that last team?
 
Level 12
Joined
Jul 27, 2008
Messages
1,181
Better do this. You just need two Real variables.
  • Team1
  • Events
    • Player - Player 1 (Red) leaves the game with a defeat
    • Player - Player 2 (Blue) leaves the game with a defeat
    • Player - Player 3 (Teal) leaves the game with a defeat
    • .. and all other team 1 players
  • Conditions
  • Actions
    • Set Team1 = (Team1 + 1.00)
  • Team2
  • Events
    • Player - Player 4 (Purple) leaves the game with a defeat
    • Player - Player 5 (Yellow) leaves the game with a defeat
    • Player - Player 6 (Orange) leaves the game with a defeat
    • .. and all other team 2 players
  • Conditions
  • Actions
    • Set Team2 = (Team2 + 1.00)
  • Defeated1
  • Events
    • Game - Team1 becomes Equal to 3.00
  • Conditions
  • Actions
    • Game - Defeat Player 1 (Red) with the message: Defeat!
    • Game - Defeat Player 2 (Blue) with the message: Defeat!
    • Game - Defeat Player 3 (Teal) with the message: Defeat!
    • ...etc
  • Defeated2
  • Events
    • Game - Team2 becomes Equal to 3.00
  • Conditions
  • Actions
    • Game - Defeat Player 4 (Purple) with the message: Defeat!
    • Game - Defeat Player 5 (Yellow) with the message: Defeat!
    • Game - Defeat Player 6 (Orange) with the message: Defeat!
    • ...etc
Better skip the events for the first two and the actions for the last two, and add them with triggers.
 
Last edited:
@ kevv2: I tried this already, but if I do it as you said, there would be a biiiiig trigger, to check if the others player are defeated too, or which team wins...
And I cannot check allies of player in a condition...

I spent more than 2 weeks on this problem, maybe it cannot be solved? D:

But I hope someone knows an answer. Thanks :D

@ Reaper2008: The teams are not fixed (there can be a game with 2v1/2v2/3v3/3v2 etc)
 
Level 6
Joined
Sep 13, 2008
Messages
261
@ Reaper2008: The teams weren't chosen in the game, the players choose them in the 'lobby'

@ doom_sheep: if I would use yours, when a enemy player dies, all your teammates, and you, will win the game, no matter how many enemies are still in the game...

Did you even try doom_sheep's. It looks sound to me. All enemies' units are dead you win. I'd hate to see the comeback if all your units are dead.

Zombies!!!!! rabble rabble rablle
 

  • Victory/Defeat_Conditions
  • 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
  • Player - Player 6 (Orange) leaves the game
  • Conditions
  • Actions
  • Player Group - Pick every player in (All allies of (Triggering player)) and do (Actions)
    • Loop - Actions
      • Set PlayGroup[(Player number of (Triggering player))] = ((Number of players in (All allies of (Triggering player))) - 1)
      • Player Group - Remove (Triggering player) from (All allies of (Triggering player))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • PlayGroup[(Player number of (Triggering player))] Equal to 0
        • Then - Actions
          • Set PlayGroup[(Player number of (Picked player))] = 0
          • Game - Defeat (Picked player) with the message: Defeat!
        • Else - Actions
would that work? I know, I have to add the Victory for the other players, but I don't know how to add that...

@kevv2: yeah that's right :D, but I first want to try a working and small trigger ;)
 
Level 2
Joined
May 11, 2009
Messages
10
Think about what you need to do:

You need to give victory to all players on one side if all players on the other are dead.

So maintain a list of zeros and ones for each team

On game start lists are filled with a 1 for each player

When player dies his/her corresponding number is set to 0

every time a player dies check if his teams list is full of zeros,

if it is then give everyone on the opposing team a victory

For dealing with different size and different number teams use a list of lists

so for 3v3 do PlayerLives[[1,1,1],[1,1,1]] (generated at runtime ofcourse)

Then to access the proper player you can do PlayerLives[TeamNumber][PlayerNumber] = whatever
 
Status
Not open for further replies.
Top