• 🏆 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 for victory

Status
Not open for further replies.
Level 10
Joined
Sep 11, 2013
Messages
319
how to make a trigger for victory like that:
team 1 (1-9 players) max 9
team 2 (1-3 players) max 3
---if team 1 kill all team 2
(kill all means all food [1unit=1food | 1structure=1food])
team 1 win

---if team 2 kill all team 1
(kill all means all food [1unit=1food | 1structure=1food])
team 2 win
 
Level 21
Joined
Nov 4, 2013
Messages
2,017
First create one "player" variable (call it Player for example) array of size 12. When you initialize the map, check the number of players in each team by setting, for instance, Player[1] = Player 1 (Red) and so on. Now, for the victory trigger, do this:

  • Victory Trigger
  • Events
    • Unit - A unit Dies
  • Conditions
  • Actions
    • (If All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Player[1] Food used Equal to 0
        • (Player[2] Food used Equal to 0
        • (Player[3] Food used Equal to 0
        • (Player[4] Food used Equal to 0
        • (Player[5] Food used Equal to 0
        • (Player[6] Food used Equal to 0
        • (Player[7] Food used Equal to 0
        • (Player[8] Food used Equal to 0
        • (Player[9] Food used Equal to 0
      • Then - Actions
        • Game - Defeat Player[1] with the message: Defeat!
        • Game - Defeat Player[2] with the message: Defeat!
        • Game - Defeat Player[3] with the message: Defeat!
        • Game - Defeat Player[4] with the message: Defeat!
        • Game - Defeat Player[5] with the message: Defeat!
        • Game - Defeat Player[6] with the message: Defeat!
        • Game - Defeat Player[7] with the message: Defeat!
        • Game - Defeat Player[8] with the message: Defeat!
        • Game - Defeat Player[9] with the message: Defeat!
        • Game - Victory Player[10] (Show dialogs, Show scores)
        • Game - Victory Player[11] (Show dialogs, Show scores)
        • Game - Victory Player[12] (Show dialogs, Show scores)
      • Else - Actions
    • (If All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Player[10] Food used Equal to 0
        • (Player[11] Food used Equal to 0
        • (Player[12] Food used Equal to 0
      • Then - Actions
        • Game - Victory Player[1] (Show dialogs, Show scores)
        • Game - Victory Player[2] (Show dialogs, Show scores)
        • Game - Victory Player[3] (Show dialogs, Show scores)
        • Game - Victory Player[4] (Show dialogs, Show scores)
        • Game - Victory Player[5] (Show dialogs, Show scores)
        • Game - Victory Player[6] (Show dialogs, Show scores)
        • Game - Victory Player[7] (Show dialogs, Show scores)
        • Game - Victory Player[8] (Show dialogs, Show scores)
        • Game - Victory Player[9] (Show dialogs, Show scores)
        • Game - Defeat Player[10] with the message: Defeat!
        • Game - Defeat Player[11] with the message: Defeat!
        • Game - Defeat Player[12] with the message: Defeat!
      • Else - Actions
The players from 1-9 are the ones in team 1 and the players from 10-12 are team 2 players. You can set them as you like in the initialization trigger. Player[1] can be Player 10 (Teal), it depends on the game you're creating if it's just any player that can enter either team.
 
Status
Not open for further replies.
Top