| 11-25-2002, 05:19 AM | #1 |
I am pretty much a newb on leaderboards, so help would be appreciated :). I want to make it so when a player kills all of the other player's units, that player gets a point. Then the other player's units will respawn. When one player gets 5 points, he wins. This is pretty simple, but I have no clue how to do it :). |
| 11-26-2002, 01:39 AM | #2 |
I'm too lazy to write everything out for you, but here's some basics. First off, create variables for the leaderboard. (If you don't know how to do this, press 'Control+B' in the trigger menu) Make these variables: - Leaderboard (Let's call it "lbd") - Integers (One for each player: i.e. "player1points") NOTICE - Make an integer like that for EVERY playable slot NOTE - You could make an integer varaible array if you know how NOTE 2 - You do not have to create leaderboard. To add players to a leader board, use the trigger action: LeaderBoard - Add Player Y to ("lbd") with a value (player1points) {i.e. our variables} Now to show leaderboards, use this action: LeaderBoard - Show ("lbd") Next you'll have to make a trigger that has the events and conditions that you want to change the score with. In the trigger, use this action. If/Then/Else - If - [Player Comparrison] - If (owner of killing unit) equal to (Player 1), then do action - [Set Variable] - Set (player1points) to {Function=Addition} (player1points + 1), else [Do Nothing] NOTE 3 - Now create an action this for every player changing the Player 1 to whatever and the player1points to the player that you changed the other option for. - - - Now make a periodic trigger that fires every 2 seconds or so. Use this action: Leaderboard - change the value for (player Y) to (playerYpoints) NOTE 4 - The 'Y' represents any player. Use this action 1 time in this trigger for EACH player. - - - OK, now to end in victory, just make a periodic trigger for every (whatever seconds). Use If/Then/Else actions to determine if the integer variables are greater than 4 (or whatever). If so, THEN end in victory for player, ELSE do nothing. - - - Whoa, that was a lot of work. I hope I didn't forget anything. Remind me never to write something this long again. :) |
