| 07-27-2004, 07:24 AM | #1 |
There are 12 players, with each team being a group of 3 players, making 4 groups. I need a trigger (just one trigger, to reduce lag) that checks when a unit has been killed, and it gets the player that owned the killing unit, checks if the unit that is dying is owned by player that owns the killing unit, and if the killing unit is owned by an ally of the owner of the dying unit. Here, take a look at what I have so far: - - - - - - - - - - - - - - - - - - - - - - <Events> Unit - A unit Dies <Conditions> (Owner of (Killing unit)) Not equal to (Owner of (Dying unit)) ((Owner of (Killing unit)) is an ally of (Owner of (Dying unit))) Equal to False <Actions> N/A - - - - - - - - - - - - - - - - - - - - - - I need some help on getting the player that killed the unit, and adding a point to that player's score, using only one trigger. Allies "teamkilling" or players killing their own units will not add to their score (for obvious reasons) ;) BTW, I already have triggers that set up the leaderboard, that sort the players by value, and that check to see if the player slot is occupied at the start of the game at all, or if the player leaves (either one of the previous triggers removes their name from the leaderboard.) |
| 07-27-2004, 12:37 PM | #2 |
Getting the player of the killer would be done by (owner of (killing unit)), and adding a point to the score you could use an array of integer variables (each index corresponding to the player's number) to store it, like so: score[Player Number of(Killing Unit)] = score[Player Number of(Killing Unit)] + 1 It may look confusing but will actually save you time in the long run when you need to access player's scores. If you need help with anything, just ask. |
| 07-27-2004, 06:37 PM | #3 |
I dont understand what you mean. Is It: Make an integer array variable that has a size of 12, then....ok then you lost me. :\ Uhmmmm....help? :( |
| 07-27-2004, 09:11 PM | #4 |
Since a lot of people have asked how to make a leaderboard that show score, I have made a demo map, check it out: http://www.wc3campaigns.com/showthread.php?t=61177 |
| 07-27-2004, 10:56 PM | #5 |
Make an integer variable array that has the size of 12, then: Events: Your Events Conditions: Your Conditions Actions: set IntegerVariableArray[player number of owner of killing unit] = IntegerVariableArray[player number of owner of killing unit] + 1 Leaderboard - Change the value for (Owner of (Killing unit)) in (Last created leaderboard) to IntegerVariableArray[(Player number of (Owner of (Killing unit)))] Leaderboard - Sort (Last created leaderboard) by Value in Descending order In the room for the array, pick Player - Player number. In the next field pick owner of unit, in the next field pick Event Response - Killing Unit. For the next one you have to do Arithmetic, and then do what i just told you and then set + 1 in the next fields (quite obvious). |
