• 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 conditions help :)

Status
Not open for further replies.
Level 21
Joined
Aug 21, 2005
Messages
3,699
  • Defeat Conditions
    • Events
      • Time - Elapsed game time is 1800.00 seconds
    • Conditions
    • Actions
      • Game - Defeat Player 1 (Red) with the message: Defeat! You didn't ...
      • Game - Victory Player 2 (Blue)
This will defeat player 1 when time runs out. Add the first action for every teammember of Team 1 and the last action for every teammember of Team 2.

  • Victory Conditions
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to Flag
    • Actions
      • Item - Remove (Item being manipulated)
      • Set FlagsCaptured = (FlagsCaptured + 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • FlagsCaptured Equal to 30
        • Then - Actions
          • Game - Victory Player 1 (Red) (Show dialogs, Show scores)
          • Game - Defeat Player 1 (Red) with the message: Defeat! The other team captured all flags!
        • Else - Actions
          • Do nothing
"FlagsCaptured" is an Integer Variable with Initial Value = 0 and no Array.

The last trigger assumes that the "Flags" are items which you can take. Once you took a flag, the flag is removed from the game. I did it with items because I didn't know what you meant by "flag"...
 
Level 21
Joined
Aug 21, 2005
Messages
3,699
right...
so does that mean there are 30 shared flags or 60 flags? I suspect you mean 60 flags because otherwise no team would be able to get all 30 flags...

Either way, it would only make a small adaption:
  • Defeat Conditions
    • Events
      • Time - Elapsed game time is 1800.00 seconds
    • Conditions
    • Actions
      • Game - Defeat Player 1 (Red) with the message: Defeat! You didn't ...
      • Game - Defeat Player 2 (Blue) with the message: Defeat! You didn't ...
This will defeat all players after 30 minutes.

  • Victory Conditions
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to Flag
    • Actions
      • Item - Remove (Item being manipulated)
      • Set Flagscaptured[(Team number of (Owner of (Triggering unit)))] = (FlagsCaptured[(Team number of (Owner of (Triggering unit)))] + 1)
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • FlagsCaptured[1] Equal to 30
          • Then - Actions
            • Game - Victory Player 1 (Red) (Show dialogs, Show scores)
            • Game - Defeat Player 2 (Blue) with the message: Defeat! The other team captured all flags!
          • Else - Actions
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • FlagsCaptured[2] Equal to 30
              • Then - Actions
                • Game - Victory Player 2 (Blue) (Show dialogs, Show scores)
                • Game - Defeat Player 1 (Red) with the message: Defeat! The other team captured all flags!
              • Else - Actions
                • Do nothing
This time, Flagscaptured has an array of 2, 1 for each team.
 
Status
Not open for further replies.
Top