Warcraft III resources & community, 2003–2006 · archived

Leader bord triggers plz???

7 posts
#1

Leader bord triggers plz???

:( :( could u guys show me how to make and add points to a leader board i have so many maps that have to have a leader board its crazy plz show me the triggers for it this is one like 2 triggers i dont know i have seen it how they do it in other maps but got confused :( :( :( :( :( :( plz idd apreciate it if udd help ive looked evey where they have tutorails for it in german and thats all so plz help or at least tell me if theres a post sum where :( :(
#2
ok i think i have found it can u guys tell me if this is right

________________
Events
Map Initialization
Conditions
---
Actions
Create a leaderboard

Update Kills trig

Events
A unit dies
Conditions
(Owner of (Killing Unit)) not equal to neutral hostile
(Owner of (Killing Unit)) not equal to neutral passive
(Owner of (Killing Unit)) not equal to whoever players aren't supposed to have score
Actions
Set the score of (Owner of (Killing unit)) in Leaderboard to Score of Owner of Killing unit+1
#3
My Example:

Leaderboard
    Events
        Time - Elapsed game time is 5.00 seconds
    Conditions
    Actions
        Leaderboard - Create a leaderboard for (All players) titled Hero Kills
        Leaderboard - Show (Last created leaderboard)
        Wait 0.20 seconds
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Player 1 (Red) slot status) Equal to Is playing
            Then - Actions
                Leaderboard - Add Player 1 (Red) to (Last created leaderboard) with label (Name of Player 1 (Red)) and value 0
            Else - Actions


Set in the player who are playing, repeat for more players.

Leaderboard Updater
    Events
        Time - Every 0.50 seconds of game time
    Conditions
    Actions
        Leaderboard - Sort (Last created leaderboard) by Value in Descending order


Updates in duh

Red Kills
    Events
        Unit - A unit Dies
    Conditions
        ((Dying unit) belongs to an enemy of Player 1 (Red)) Equal to True
        (Killing unit) Equal to z_Red
    Actions
        Set aR = (aR + 1)
        Leaderboard - Change the value for Player 1 (Red) in (Last created leaderboard) to aR


z_red is my variable for the red hero
aR is my variable for reds total kills
repeat for multiple players/heroes

Red Leaves
    Events
        Player - Player 1 (Red) leaves the game
    Conditions
    Actions
        Unit - Remove z_Red from the game
        Game - Display to (All players) for 10.00 seconds the text: ((Name of Player 1 (Red)) +  has left the game.)
        Leaderboard - Remove Player 1 (Red) from (Last created leaderboard)


Removes from the board not required
#4
Rather than sorting it on a periodic interval, you could just sort it right after you update any player's value.
#5
True
#6
k thx everyone ive always needed that trigger it was driving me crazy :twisted: :twisted: :twisted: :twisted: :twisted: :twisted: :twisted: :twisted: :twisted: so thx again
#7
to prevent repetative work, use integers, make a variable named 'player' (type: player; array (number of players))

The setup trigger:

Leaderboard
Events
Time - Elapsed game time is 5.00 seconds
Conditions
Actions
Leaderboard - Create a leaderboard for (All players) titled Hero Kills
Leaderboard - Show (Last created leaderboard)
Wait 0.20 seconds
For each integer (1-x)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Player(x) Equal to Is playing
Then - Actions
Leaderboard - Add Player(x) to (Last created leaderboard) with label (Name of Player(x) and value 0
Else - Actions