Ok I followed a tutorial by OneTwoSC and sent him a pm as to why it isnt working but he is not responsive. SO:
Basically I want my leaderboard to track the kills and deaths of the players. But at the start of the game, If the player is not in game it kills all units. SO i set the leaderboard up accordingly so it does not add those deaths and make the leaderboard look messy. So here is what I have done..Ill show the print screens of the updates of deaths/kills the setting up of the leaderboard, and the error message in the trigger debugger.
EDIT: It also appears that the kills is working but the deaths aint - tbh I am not sure at all
Trying to access an element past the end of an array... Here's the absolute most common issue I see when this comes up. People assume it means you're getting a really big number that goes past the end of your array. Not so! You are getting a negative value, which is normally attributed to a null or nonfunctional return value. I'm taking finals this week, can't be bothered to open up the map and take a look, but....
Look around for anything that might be returning -1 (Things return -1 when they're not working properly). Especially if you ever use the "triggering whatever" function. Always assign your stuff to a variable right when it's created and reference the variable instead.
Just at a glance, I noticed in your Update Deaths trigger you have the condition check that the owner of the killing unit is equal to 1 through 10; maybe you need an OR statement.
Oh wen i got rid of them it still came up i see hat u mean now, maybe its the triggering player for that vbariable:O
he meant, when you put your conditions like that in your update deaths trigger; it means the owner of the dying unit must be Players 1 AND 2 AND 3 AND 4 AND 5 AND 6 yada2~
well obviously you cant be Multiple players at once...
You need an OR statement for the deaths trigger to work.
As for your update kills trigger... I dont see anything obviously wrong in there hmm..
However I must ask, to test the trigger, did you use a hostile unit to kill your hero? If yes, then the problem would definitely be accessing an array past its limits; 'cause the hostile player is either 14 or 15 i believe, while the size of your array is only 8.
Trying to access an element past the end of an array... Here's the absolute most common issue I see when this comes up. People assume it means you're getting a really big number that goes past the end of your array. Not so! You are getting a negative value, which is normally attributed to a null or nonfunctional return value. I'm taking finals this week, can't be bothered to open up the map and take a look, but....
I think Blizz has updated sc2 to show when a negative index is used. It appears as "Negative Indexes not supported.". I am very sure i've seen the error thousands of times when debugging before :) i might be wrong tho.
No, idid not use a hostile unit just from testing on battle.net with players and killing my self I addded ORs for the kills and deaths and I think it is working but it will probably bug outon me :P
Let us know if you get it working. If not, after rereading your original post, here's how I would accomplish it (not saying it's the best way or anything, but I use a similar method and in my map and it works ok)
Also note, I use Killing Player, not Owner of (Killing Unit).
I found that using Owner of (Killing Unit) can throw a trigger error when the killing unit dies before it kills the dying unit. Specifically, this happens when units attack with missile attacks, like Marauders and Stalkers. For example, lets say a Stalker shoots a Marauder, and the Stalker is killed somehow before it's lasers hit the Marauder. Then, after dying, the Stalker's lasers hit the Marauder and kill him. If you use Owner of (Killing Unit), it will cause an error, since the Killing unit is dead! Use Killing Player to solve this.
Event
Any Unit Dies
Conditions
Phase==1 // when your map starts, have Phase=0, then after all the first units are killed like you said, set the Phase=1
Killing Player >=1
Killing Player <= 8
Actions
Modify TotalKills(Killing Player): +1
Modify TotalDeaths(Triggering Player): +1
Update Leaderboard at column 3 row KillingPlayer to Text(TotalKills(Killing Player)
Update Leaderboard at column 3 row TriggeringPlayer to Text(TotalDeaths(Triggering Player)
Last thing to note, if you have rocks in your map, killing the rocks will count as a kill. You could add a condition like Triggering Player!=0 to fix this (since player 0 is by default a neutral player than owns rocks)
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Ok I followed a tutorial by OneTwoSC and sent him a pm as to why it isnt working but he is not responsive. SO: Basically I want my leaderboard to track the kills and deaths of the players. But at the start of the game, If the player is not in game it kills all units. SO i set the leaderboard up accordingly so it does not add those deaths and make the leaderboard look messy. So here is what I have done..Ill show the print screens of the updates of deaths/kills the setting up of the leaderboard, and the error message in the trigger debugger.
EDIT: It also appears that the kills is working but the deaths aint - tbh I am not sure at all
Bump
bump
Trying to access an element past the end of an array... Here's the absolute most common issue I see when this comes up. People assume it means you're getting a really big number that goes past the end of your array. Not so! You are getting a negative value, which is normally attributed to a null or nonfunctional return value. I'm taking finals this week, can't be bothered to open up the map and take a look, but....
Look around for anything that might be returning -1 (Things return -1 when they're not working properly). Especially if you ever use the "triggering whatever" function. Always assign your stuff to a variable right when it's created and reference the variable instead.
@CrazyTwigman: Go
Just at a glance, I noticed in your Update Deaths trigger you have the condition check that the owner of the killing unit is equal to 1 through 10; maybe you need an OR statement.
I have 8 players onmy map so, what you mean by or?
Oh wen i got rid of them it still came up i see hat u mean now, maybe its the triggering player for that vbariable:O
he meant, when you put your conditions like that in your update deaths trigger; it means the owner of the dying unit must be Players 1 AND 2 AND 3 AND 4 AND 5 AND 6 yada2~
well obviously you cant be Multiple players at once...
You need an OR statement for the deaths trigger to work.
As for your update kills trigger... I dont see anything obviously wrong in there hmm..
However I must ask, to test the trigger, did you use a hostile unit to kill your hero? If yes, then the problem would definitely be accessing an array past its limits; 'cause the hostile player is either 14 or 15 i believe, while the size of your array is only 8.
I think Blizz has updated sc2 to show when a negative index is used. It appears as "Negative Indexes not supported.". I am very sure i've seen the error thousands of times when debugging before :) i might be wrong tho.
No, idid not use a hostile unit just from testing on battle.net with players and killing my self I addded ORs for the kills and deaths and I think it is working but it will probably bug outon me :P
@CrazyTwigman
Let us know if you get it working. If not, after rereading your original post, here's how I would accomplish it (not saying it's the best way or anything, but I use a similar method and in my map and it works ok)
Also note, I use Killing Player, not Owner of (Killing Unit).
I found that using Owner of (Killing Unit) can throw a trigger error when the killing unit dies before it kills the dying unit. Specifically, this happens when units attack with missile attacks, like Marauders and Stalkers. For example, lets say a Stalker shoots a Marauder, and the Stalker is killed somehow before it's lasers hit the Marauder. Then, after dying, the Stalker's lasers hit the Marauder and kill him. If you use Owner of (Killing Unit), it will cause an error, since the Killing unit is dead! Use Killing Player to solve this.
Event
Any Unit Dies
Conditions
Phase==1 // when your map starts, have Phase=0, then after all the first units are killed like you said, set the Phase=1
Killing Player >=1
Killing Player <= 8
Actions
Modify TotalKills(Killing Player): +1
Modify TotalDeaths(Triggering Player): +1
Update Leaderboard at column 3 row KillingPlayer to Text(TotalKills(Killing Player)
Update Leaderboard at column 3 row TriggeringPlayer to Text(TotalDeaths(Triggering Player)
Last thing to note, if you have rocks in your map, killing the rocks will count as a kill. You could add a condition like Triggering Player!=0 to fix this (since player 0 is by default a neutral player than owns rocks)