• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Trigger] Set a win trigger who works...

Status
Not open for further replies.
Level 4
Joined
Apr 22, 2020
Messages
53
Hello !

I made a win triggers who was working perfectly against AI.

But now I test it on BNET, it doesn't work anymore.

I think it's linked to people who left before the defeat. So I set this :

  • Team 1 Victory
    • Events
      • Player - Player 4 (Pourpre) leaves the game
      • Player - Player 5 (Jaune) leaves the game
      • Player - Player 6 (Orange) leaves the game
      • Player - Player 4 (Pourpre) leaves the game with a defeat
      • Player - Player 5 (Jaune) leaves the game with a defeat
      • Player - Player 6 (Orange) leaves the game with a defeat
    • Conditions
      • And - All (Conditions) are true
        • Conditions
          • ((Player 4 (Pourpre) slot status) Egal to Not used) or ((Player 4 (Pourpre) slot status) Egal to has left the game)
          • ((Player 5 (Jaune) slot status) Egal to Not used) or ((Player 5 (Jaune) slot status) Egal to has left the game)
          • ((Player 6 (Orange) slot status) Egal to Not used) or ((Player 6 (Orange) slot status) Egal to has left the game)
    • Actions
      • Game - Victory Player 1 (Rouge) (show dialogs, show scores)
      • Game- Victory Player 2 (Bleu) (show dialogs, show scores)
      • Game - Victory Player 3 (Cyan) (show dialogs, show scores)
There is another one with all others players (1, 2 and 3)

But even with this, it doesn't work either... I don't know what to do... :(
 
Level 25
Joined
Sep 26, 2009
Messages
2,378
I am not sure if this will solve your issue, but perhaps you could try to store players of the respective teams in player group variables. Then have a trigger that when a player leaves, he is removed from all player groups and next check if one or the other playe group is empty. If one of them is indeed empty, then the other team wins.

Something like this:

  • Game Start
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • -------- Set up team 1 --------
      • Player Group - Add Player 1 (Red) to Players_Team1
      • Player Group - Add Player 2 (Blue) to Players_Team1
      • Player Group - Add Player 3 (Teal) to Players_Team1
      • -------- Set up team 2 --------
      • Player Group - Add Player 4 (Purple) to Players_Team2
      • Player Group - Add Player 5 (Yellow) to Players_Team2
      • Player Group - Add Player 6 (Orange) to Players_Team2
      • -------- Add events --------
      • Player Group - Pick every player in Players_Team1 and do (Actions)
        • Loop - Actions
          • Trigger - Add to Player Leaves <gen> the event (Player - (Picked player) leaves the game)
      • Player Group - Pick every player in Players_Team2 and do (Actions)
        • Loop - Actions
          • Trigger - Add to Player Leaves <gen> the event (Player - (Picked player) leaves the game)
  • Player Leaves
    • Events
    • Conditions
    • Actions
      • Player Group - Remove (Triggering player) from Players_Team1.
      • Player Group - Remove (Triggering player) from Players_Team2.
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of players in Players_Team1) Equal to 0
        • Then - Actions
          • Trigger - Turn off (This trigger)
          • -------- victory for team 2 --------
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Number of players in Players_Team2) Equal to 0
            • Then - Actions
              • Trigger - Turn off (This trigger)
              • -------- victory for team 1 --------
            • Else - Actions
 
Status
Not open for further replies.
Top