• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[Trigger] Victory

Status
Not open for further replies.
Level 1
Joined
Aug 9, 2008
Messages
4
I need help on how to make victory in a game from a certain amount of kills that displays off a Multiboard or Leaderboard. Can anyone help me?
 
Level 14
Joined
Apr 21, 2007
Messages
1,465
Well, you need to make a "real" variable. I'll call it CountKills and lets say the creatures you need to kill are ghouls. Now we need the following trigger:
  • Events
    • Unit - A unit Dies
  • Conditions
    • (Unit-type of (Dying unit)) Equal to Ghoul
  • Actions
    • Set CountKills = (CountKills + 1.00)
Now that we have that we need a trigger that will make a player victorious when he kills 50 ghouls.
  • Events
    • Game - a becomes Greater than or equal to 50.00
  • Conditions
  • Actions
    • Game - Victory Player 1 (Red) (Show dialogs, Show scores)
Now, if you want to have a separate kill rate for every player you will need to make as many variables as there are players and add a condition which states who is the owner of the killing unit.
 
Level 21
Joined
Aug 21, 2005
Messages
3,699
Merge those triggers...

  • Events
    • Unit - a unit dies
  • Conditions
    • Unit type of (dying unit) equal to ghoul
  • Actions
    • Set Killcount[Player number of Owner of Killing unit] = Killcount[Player number of Owner of Killing unit] + 1 // this is an integer var
    • If Killcount[Player number of Owner of Killing unit] larger than or equal to 50 do (multiple actions):
      • Loop - actions
        • Victory Owner of (killing unit) with the message: "You own"
 
Status
Not open for further replies.
Top