Im trying to add as many players to the leaderboard with as many that are actually playing. Meaning that even if my game supports up to 8 players i will do an increment from 1-8, adding only as many players that are in the game (meaning if there are 4 only 4 players will be added even though the game supports up to 8 players). I successfully managed to do this.
Now what i have to do is make another increment for the kills
Change the value (Player((Integer A))) in (Last created leaderboard) to Kills[IntegerA] This will set the kill array to update multiple users who play the game
Only problem is starcraft doesnt really have a configuration like this which kinda upsets me considering Warcraft III had a far more intricate Trigger system than Starcraft II, however Starcraft II has a far better data editor.
in warcraft III this was crucial for whenever i created a wave game, as it allowed the game to only keep track of data for as many players as there were in the game.
I'd set a local variable P that represents the triggering player integer.
And then set the value for the kills column and Pth row.
Edit: You can use the event any unit dies. It triggers everytime a unit dies. First set P to the killing player. Increment his kill count. Im guessing you used an array kills[] to keep track of each player's kills so do modify variable kills[P] += 1. And then update the leaderboard kills column, Pth row to (text(kills[P]))
Your right, okay i changed my algorithm to match SCII's slightly different system this time around, maybe i was to quick to judge. If I can get this one thing working, ill post an advanced leader board tutorial for people that wanna see how to display level of a unit, health %, and etc etc...
I followed the idea you gave me there and here is my new algorithm, It should work, everytime i follow the logic it just makes sense, yet the kill count is still not displaying so here goes.
And no the number Kills[] is for some reason not displaying, im assuming its in a wrong row or something, but i need someone to review the code for any errors.
For your Kill Counter trigger, try replacing Triggering Player with Killing Player. I think that Triggering Player is returning an incorrect value, such as the player who owns the dying unit.
In addition, for your Kill Count Operator trigger, I believe the row and column values need to be switched, since it iterates players by rows.
Like so: Leaderboard - Set LeaderBoard item text at column 2 and row IntegerA to (Text(Kills[IntegerA]))
I had the same problem, it's really annoying.
To fix mine i switched "For each integer" to "Pick each integer", for some reason it makes all the difference.
Inside the actions: "Use picked integer" to refer to each increment.
Hope this works for you! =)
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Alright guys this is what im trying to do
Im trying to add as many players to the leaderboard with as many that are actually playing. Meaning that even if my game supports up to 8 players i will do an increment from 1-8, adding only as many players that are in the game (meaning if there are 4 only 4 players will be added even though the game supports up to 8 players). I successfully managed to do this.
Now what i have to do is make another increment for the kills
Change the value (Player((Integer A))) in (Last created leaderboard) to Kills[IntegerA] This will set the kill array to update multiple users who play the game
Only problem is starcraft doesnt really have a configuration like this which kinda upsets me considering Warcraft III had a far more intricate Trigger system than Starcraft II, however Starcraft II has a far better data editor.
in warcraft III this was crucial for whenever i created a wave game, as it allowed the game to only keep track of data for as many players as there were in the game.
I'd set a local variable P that represents the triggering player integer.
And then set the value for the kills column and Pth row.
Edit: You can use the event any unit dies. It triggers everytime a unit dies. First set P to the killing player. Increment his kill count. Im guessing you used an array kills[] to keep track of each player's kills so do modify variable kills[P] += 1. And then update the leaderboard kills column, Pth row to (text(kills[P]))
Your right, okay i changed my algorithm to match SCII's slightly different system this time around, maybe i was to quick to judge. If I can get this one thing working, ill post an advanced leader board tutorial for people that wanna see how to display level of a unit, health %, and etc etc...
I followed the idea you gave me there and here is my new algorithm, It should work, everytime i follow the logic it just makes sense, yet the kill count is still not displaying so here goes.
Local Variables:
Leader Board Trigger
Kill Counter trigger
Kill count operator (basically just does the incrementing and updating of kill count on the leaderboard)
My integer A is essentially your "Player" variable. And i do believe (Triggering Player) returns a number so that should be just fine.
Hmm i cant help you, but i think there may be something wrong with your leaderboard layout rather than the logic you created.
If your not even getting a number try to check whether your kills counter really is displaying in your table
Anyone have an idea of how this should be done?
And no the number Kills[] is for some reason not displaying, im assuming its in a wrong row or something, but i need someone to review the code for any errors.
For your Kill Counter trigger, try replacing Triggering Player with Killing Player. I think that Triggering Player is returning an incorrect value, such as the player who owns the dying unit.
In addition, for your Kill Count Operator trigger, I believe the row and column values need to be switched, since it iterates players by rows.
Like so: Leaderboard - Set LeaderBoard item text at column 2 and row IntegerA to (Text(Kills[IntegerA]))
What you said makes sense, so i corrected what you said, but now im getting an Array Index out of bounds exception in my UnitKillsCount
Edit: O wait a friggin second i know what i did wrong one sec.
Bah still not displaying. Here is my new code:
KillCounter
Kills Operator
I had the same problem, it's really annoying. To fix mine i switched "For each integer" to "Pick each integer", for some reason it makes all the difference. Inside the actions: "Use picked integer" to refer to each increment. Hope this works for you! =)