| 02-09-2004, 04:26 PM | #1 |
Maybe this question has been answered somewhere else but Ive browsed the forums for a while and couldnt find an answer: I already have a working leaderboard displaying kills for my 4 players map. Points: -Player 1's name (score) -Player 2's name (score) -Player 3's name (score) -Player 4's name (score) The map is played in 2 teams of 2 players (1 and 2) (3 and 4) and I want the leaderboard to be displayed like this Points: -Team 1 Score (player 1 kills + player 2 kills) -Player 1's name (score) -Player 2's name (score) -Team 2 Score (player 3 kills + player 4 kills) -Player 3's name (score) -Player 4's name (score) I know its not hard to do but I tend to make complicate triggers for simple things and Id like to know what the best way to do it. Thanks. |
| 02-09-2004, 06:20 PM | #2 |
If you can already create a score for players then just do the same thing but instead of using just one players score use arithmatic/addition (whatever you have for Player1 + whatever you have for player 2) Understanble? |
| 02-09-2004, 07:41 PM | #3 |
Simple. Choose 2 players that ARE NOT on your map (by what you said, I would say players 5 and 6) Then add the players to the leaderboard like so Code:
Add player 5 to leaderboard with the title "Team 1" blah blah... Add player 1 to leaderboard blah blah.... Add player 2 to leaderboard blah blah.... Add player 6 to leaderboard with the title "Team 1" blah blah... Add player 3 to leaderboard blah blah.... Add player 4 to leaderboard blah blah.... If you want a blank space between them, then add player 7 to the leaderboard after player 2, and make its title AND value transparent. Then in your kill trigger just do Arithmatic like said. So you kill trigger would set the kills for the players and at the end of the kills trigger you would add Code:
Set player 5 value to (kills[1] + kills[2]) Set Player 6 value to (kills[3] + kills[4]) |
| 02-09-2004, 11:56 PM | #4 | |
Quote:
The numbers here: Kills[x], is it an array or the player number? I have some problems making it work.. |
| 02-10-2004, 04:46 AM | #5 |
You do store your kills in an array dont you? And when a person gets a kill don't you do a Code:
Set Kills[player number(owner of(killing unit)] = Kills[player number(owner of(killing unit)] +1 Change value of (owner of(killing unit)) to Kills[player number(owner of(killing unit)] ?? if so then Set player 5 value to (kills[1] + kills[2]) Set Player 6 value to (kills[3] + kills[4]) Is what you need, no "Player number" or anything, just exactly what is above. |
