Leaderboard

DonMushroom

Member
Reaction score
4
I have a leader board that records kills and adds 1 every time a unit dies.

Unit Kills
Events
Unit - Any Unit dies
Local Variables
Conditions
(Owner of (Killing unit)) != (Owner of (Triggering unit))
Actions
Variable - Modify Kills[(Owner of (Killing unit))]: + 1
Leaderboard - Set Kill Board item text at column 2 and row (Owner of (Killing unit)) to (Text(Kills[(Owner of (Killing unit))]))

It does what its means to apart from when a zergling turns to a baneling. I get a trigger error saying "trying to access an element passed the end of an array"

Can anyone think of how i can get around this? :)
 

Dave312

Censored for your safe viewing
Reaction score
269
You could add another condition which checks if the killing units exists:
(Killing Unit) != No Unit
 

Dave312

Censored for your safe viewing
Reaction score
269
I've looked into this some more and found that the Zergling > Baneling morph isn't actually a morph. What happens is the zergling trains the baneling in much the same way as a barracks trains a marine, and then when the training is complete, the zergling is killed. This explains why the unit dies event runs when your zergling is morphed into a baneling. When the zerging dies, the killing player is player 16 (which doesn't actually exist). So what you can do is create a condition which checks if the killing player is player 16
(Owner of (Killing Unit)) != 16
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top