• 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.

[Trigger] Leaderboard (Point system)

Status
Not open for further replies.
Level 10
Joined
Mar 30, 2007
Messages
447
Alright, so im making a map which is not my usual genre so im not used to thise kind of triggering.

My worst fields would be leaderboards and spells...

And i need help with leaderboards.


How do i make a trigger, so that when a player, kills another unit owned by another player (Unit type does not matter, each player will only have ONE unit not a hero though) the killing player gains a point. Then after a certin timer expires, the person with the most points wins the game.
 
Level 18
Joined
May 27, 2007
Messages
1,689
alright this will consist of a few triggers to make everything work right (hopefully) what you need to do is make two variables "Timer" and "PlayerKills" timer is a, you guessed it TIMER Variable! and the player kills variabls is an ARRAY INTEGER variable so then after that you just make these couple triggers
  • LeaderBoard
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • Leaderboard - Create a leaderboard for (All players) titled Kills
      • 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
              • ((Picked player) slot status) Equal to Is playing
              • ((Picked player) controller) Equal to User
            • Then - Actions
              • Leaderboard - Add (Picked player) to (Last created leaderboard) with label (Name of (Picked player)) and value 0
            • Else - Actions
      • Leaderboard - Show (Last created leaderboard)
  • SetLeaderBoard
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Dying unit) belongs to an enemy of (Owner of (Killing unit))) Equal to True
    • Actions
      • Set PlayerKills[(Player number of (Owner of (Killing unit)))] = (PlayerKills[(Player number of (Owner of (Killing unit)))] + 1)
      • Leaderboard - Change the value for (Owner of (Killing unit)) in (Last created leaderboard) to PlayerKills[(Player number of (Owner of (Killing unit)))]
      • Leaderboard - Sort (Last created leaderboard) by Value in Descending order

  • Leave
    • Events
      • Player - Player 1 (Red) leaves the game
      • Player - Player 2 (Blue) leaves the game
    • Conditions
    • Actions
      • Leaderboard - Remove (Triggering player) from (Last created leaderboard)
  • Timer
    • Events
      • Time - Timer expires
    • Conditions
    • Actions
      • Game - Victory (Player in position 1 of (Last created leaderboard)) (Show dialogs, Show scores)
      • Game - Defeat (Player in position 2 of (Last created leaderboard)) with the message: Defeat!
BTW you will need to set the timer variable to whatever time limit you want in order to have it work with the timer. I made that for just two players, but you can expand it to more by just adding to the last trigger more defeats or however you wish to do that and by adding more players to the first trigger GL and if u need help i can give you a demo map or soemthing

EDIT: I decided to just include a demo map to help out if needed
 

Attachments

  • Leaderboard.w3x
    18.9 KB · Views: 59
Last edited:
Level 21
Joined
Jan 5, 2005
Messages
3,515
if you want to add more functions and make a leader board which has alot more details you can make a multiboard. multiboards allows you to do things like seperate the two teams, add player icons, show kills totals, the time and more. leaderboards are quite limited. if you would prefer a multiboard we can supply you with the barebones for one, if you are happy with a leaderboard use famouspker49's fantastic looking trigger :)
 
Status
Not open for further replies.
Top