• 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.
  • Create a faction for Warcraft 3 and enter Hive's 19th Techtree Contest: Co-Op Commanders! Click here to enter!
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 21st Texturing Contest: Upgrade is now concluded, time to vote for your favourite set of icons! Click here to vote!

Victory Condition

Status
Not open for further replies.
Level 17
Joined
Dec 15, 2011
Messages
1,423
You will need an integer array, a player var and an integer var.

Event A unit dies
Cond
Action
Pick all players and do actions
Set TempPlayer = picked player
If owner of triggering unit belongs to an enemy of TempPlayer
Then
set TempInt = player number of TempPlayer
set Counter[TempInt] = Counter[TempInt] + 1
If Counter[TempInt] >= 50 then
<set TempPlayer to victory>

I am on a phone so only pseudocode available, hope this helps :)
 
Level 3
Joined
Nov 12, 2011
Messages
46
  • counting the kills
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Owner of (Killing unit)) Equal to (Picked player)
              • (Owner of (Dying unit)) Not equal to (Owner of (Killing unit))
            • Then - Actions
              • Set kills[(Player number of (Picked player))] = (kills[(Player number of (Picked player))] + 1)
              • Game - Display to (All players) the text: ((String(kills[(Player number of (Picked player))])) + Is the total number of kills you have.)
            • Else - Actions
You can try that, as the base code

  • kills are a win
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • kills[(Player number of (Picked player))] Greater than or equal to 50
            • Then - Actions
              • Game - Victory (Player((Player number of (Picked player)))) (Show dialogs, Show scores)
            • Else - Actions
hope that helps you a bit
 
Status
Not open for further replies.
Top