HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Team 1 and Team 2 Kills Leaderboard

07-26-2004, 02:21 AM#1
NueRoN-X
alright i've figured out how to make a normal leaderboard with help from rafael br, but i really haven't found what i need. i would like a leaderboard that shows the total of team kills for each team, as well as the individuals specific kill amounts. i've looked in to maps that i've already downloaded, and have copied the leaderboard triggers as well as the variables exactly , to no avail. i don't know exactly what the problem is, and as always, any help is appreciated.
07-26-2004, 07:53 AM#2
HexenLordX
Here's one way of doing it.

Code:
Set Up Leaderboard
    Events
    Conditions
    Actions
        Wait 1.00 seconds
        For each (Integer A) from 1 to 12, do (Set Kills[(Integer A)] = 0)
        Wait 1.00 seconds
        Leaderboard - Create a leaderboard for (All players) titled Kills
        Set TheLeaderBoard = (Last created leaderboard)
        Leaderboard - Add Neutral Hostile to (Last created leaderboard) with label Team 1 Kills and value 0
        Leaderboard - Change the color of the label for Neutral Hostile in (Last created leaderboard) to (100.00%, 100.00%, 100.00%) with 0.00% transparency
        Leaderboard - Change the color of the value for Neutral Hostile in (Last created leaderboard) to (100.00%, 100.00%, 100.00%) with 0.00% transparency
        Player Group - Pick every player in Team1 and do (Leaderboard - Add (Picked player) to (Last created leaderboard) with label (Name of (Picked player)) and value 0)
        Leaderboard - Add Neutral Passive to (Last created leaderboard) with label Team 2 Kills and value 0
        Leaderboard - Change the color of the label for Neutral Passive in (Last created leaderboard) to (100.00%, 100.00%, 100.00%) with 0.00% transparency
        Leaderboard - Change the color of the value for Neutral Passive in (Last created leaderboard) to (100.00%, 100.00%, 100.00%) with 0.00% transparency
        Player Group - Pick every player in Team2 and do (Leaderboard - Add (Picked player) to (Last created leaderboard) with label (Name of (Picked player)) and value 0)
        Leaderboard - Add Neutral Victim to (Last created leaderboard) with label (Win =  + ((String(MaxTeamKills)) +  Team Kills)) and value 0
        Leaderboard - Change the display style for Neutral Victim in (Last created leaderboard) to Show the label, Hide the value, and Hide the icon
        Leaderboard - Change the color of the label for Neutral Victim in (Last created leaderboard) to (100.00%, 100.00%, 100.00%) with 0.00% transparency
        Trigger - Turn on Update Leaderboard <gen>

Code:
Update Leaderboard
    Events
    Conditions
    Actions
        Trigger - Run Team 1 Win Game <gen> (checking conditions)
        Trigger - Run Team 2 Win Game <gen> (checking conditions)
        Player Group - Pick every player in (All players) and do (Leaderboard - Change the value for (Picked player) in TheLeaderBoard to Kills[(Player number of (Picked player))])
        Leaderboard - Change the value for Neutral Hostile in TheLeaderBoard to Team1Kills
        Leaderboard - Change the value for Neutral Passive in TheLeaderBoard to Team2Kills
        Player Group - Pick every player in (All players) and do (If (((Picked player) slot status) Equal to Has left the game) then do (Unit Group - Pick every unit in (Units owned by (Picked player)) and do (Unit - Remove (Picked unit) from the game)) else do (Do nothing))
        Player Group - Pick every player in (All players) and do (If (((Picked player) slot status) Equal to Has left the game) then do (Leaderboard - Remove (Picked player) from (Last created leaderboard)) else do (Do nothing))

Code:
Team 1 Win Game
    Events
    Conditions
        Team1Kills Greater than or equal to MaxTeamKills
    Actions
        For each (Integer A) from 1 to 6, do (Unit - Move Heroes[(Integer A)] instantly to (Random point in WinnerCircle <gen>))
        For each (Integer A) from 7 to 12, do (Unit - Move Heroes[(Integer A)] instantly to (Random point in LossersCircle <gen>))
        Unit - Move Razormane Chieftain 0124 <gen> instantly to (Center of UtherEndGame <gen>)
        Player Group - Pick every player in (All players) and do (Camera - Pan camera for (Picked player) to (Center of EndGame <gen>) over 1.00 seconds)
        Game - Display to (All players) the text: Team 1 Wins!
        Leaderboard - Hide TheLeaderBoard
        Countdown Timer - Hide DuelTimerWindow
        Wait 1.00 seconds
        Animation - Play Razormane Chieftain 0124 <gen>'s Stand Hit animation
        For each (Integer A) from 7 to 12, do (Unit - Kill Heroes[(Integer A)])
        Wait 5.00 seconds
        Player Group - Pick every player in Team1 and do (Game - Victory (Picked player) (Show dialogs, Show scores))
        Player Group - Pick every player in Team2 and do (Game - Defeat (Picked player) with the message: Defeat!)

Code:
Team 2 Win Game
    Events
    Conditions
        Team2Kills Greater than or equal to MaxTeamKills
    Actions
        For each (Integer A) from 7 to 12, do (Unit - Move Heroes[(Integer A)] instantly to (Random point in WinnerCircle <gen>))
        For each (Integer A) from 1 to 6, do (Unit - Move Heroes[(Integer A)] instantly to (Random point in LossersCircle <gen>))
        Unit - Move Razormane Chieftain 0124 <gen> instantly to (Center of UtherEndGame <gen>)
        Player Group - Pick every player in (All players) and do (Camera - Pan camera for (Picked player) to (Center of EndGame <gen>) over 1.00 seconds)
        Game - Display to (All players) the text: Team 2 Wins!
        Leaderboard - Hide TheLeaderBoard
        Countdown Timer - Hide DuelTimerWindow
        Wait 1.00 seconds
        Animation - Play Razormane Chieftain 0124 <gen>'s Stand Hit animation
        For each (Integer A) from 1 to 6, do (Unit - Kill Heroes[(Integer A)])
        Wait 5.00 seconds
        Player Group - Pick every player in Team2 and do (Game - Victory (Picked player) (Show dialogs, Show scores))
        Player Group - Pick every player in Team1 and do (Game - Defeat (Picked player) with the message: Defeat!)

Dunno how useful it might be to ya though. The last two triggers, Team 1 Win and Team 2 in, are just the winning conditions for the leaderboard for each team. Basically if the team has an overall win at a certain point, it that trigger is ran and the team with the needed number of kills wins. The top two triggers are just the setup and the update.. the only two that are really needed to make a leaderboard. If you don't have it set so the team with a certain number of kills wins, the bottom two triggers aren't even needed.
07-26-2004, 07:01 PM#3
NueRoN-X
i've tried those triggers already, and theyve worked fine except for one thing .. the players that were in the game did not show up on the leaderboard. so it said

team 1 kills
(nothing)
team 2 kills
(nothing)
win = 50team kills

thats all it says , and in other arenas that had the same exact trigger that i have opened in world editor and tested .. it says this:

team 1 kills
WorldEdit 0
team 2 kills
win = 50 team kills

i am really confused .. thanks for helping hex
07-26-2004, 07:37 PM#4
HexenLordX
Quote:
Originally Posted by NueRoN-X
i've tried those triggers already, and theyve worked fine except for one thing .. the players that were in the game did not show up on the leaderboard. so it said

team 1 kills
(nothing)
team 2 kills
(nothing)
win = 50team kills

thats all it says , and in other arenas that had the same exact trigger that i have opened in world editor and tested .. it says this:

team 1 kills
WorldEdit 0
team 2 kills
win = 50 team kills

i am really confused .. thanks for helping hex

I think I see your problem.

Player Group - Pick every player in Team1 and do (Leaderboard - Add (Picked player) to (Last created leaderboard) with label (Name of (Picked player)) and value 0).

Now make sure that Team1 is a variable of type Player Group (force), same for Team2.

Make a trigger on map initialization that looks like this:
For each (Integer A) from 1 to 6, do (If (((Player((Integer A))) slot status) Equal to Is playing) then do (Player Group - Add (Player((Integer A))) to Team1) else do (Do nothing))

And another like this:

For each (Integer A) from 7 to 12, do (If (((Player((Integer A))) slot status) Equal to Is playing) then do (Player Group - Add (Player((Integer A))) to Team2) else do (Do nothing))

Now where the integer A is 1 to 6, and 7 to 12, those are the number of players. If you want three on each team, then it would be 1 to 3, 4 to 6. Get it?

The reason they are set to 1 to 6, 7 to 12 in this map is because the forces are setup like this:

Zoom (requires log in)

So make sure you set yours up like that, and then set the numbers for Integer A according to them.
07-26-2004, 09:29 PM#5
NueRoN-X
alright! i've gotten the player names to appear alright, butthey are below everything... this is what i mean :

Team 1 Kills 0
Team 2 Kills 0
Win = 50 Team Kills
WorldEdit
Computer (Player 2)

EDIT: nevermind .. it was nothing big .. just had to move actions up .. thansk a lot hex!
07-27-2004, 03:11 AM#6
HexenLordX
Quote:
Originally Posted by NueRoN-X
alright! i've gotten the player names to appear alright, butthey are below everything... this is what i mean :

Team 1 Kills 0
Team 2 Kills 0
Win = 50 Team Kills
WorldEdit
Computer (Player 2)

EDIT: nevermind .. it was nothing big .. just had to move actions up .. thansk a lot hex!

No problem. If you opened a random arena and looked at it to get the leaderboard triggers, you probably forgot to look at the map initialization triggers. Map initialization usually has something to do with leaderboards if they are in your map. Glad to help.