I would REALLY appreciate a stable "Number of enemy units player 1 killed" trigger that would be a very basic kill counter.
because ive made many different ones and it will always have problems with "suicide units" and for some very weird reason the very first kill would not work and get stored in the "kills" int.
does anyone have a link to a tutorial or could screenshot me their "Number of enemy units player 1 killed" trigger?
Well if you want to write it from scratch this should work:
Kill Count
Events
Unit - Any Unit dies
Local Variables
Conditions
(Killing unit) == Unit
(Player (Triggering player) treats player (Killing player) as Ally) == false
Actions
Variable - Set Unit Kills = (Unit Kills + 1)
It checks to make sure that the unit doing the killing is the one you want to up the kill count of, and that the killed unit is not an ally, then increases it's score variable.
EDIT: Woops, SquarelyCircle was right: the "Unit Kills" variable should have been global rather than local.
I would REALLY appreciate a stable "Number of enemy units player 1 killed" trigger that would be a very basic kill counter.
because ive made many different ones and it will always have problems with "suicide units" and for some very weird reason the very first kill would not work and get stored in the "kills" int.
does anyone have a link to a tutorial or could screenshot me their "Number of enemy units player 1 killed" trigger?
thanks
Just check the units killed score value, only attributes units that give kill credit.
awww man... what is the deal here?
this is what im using
Variable - Set Kills player 1 = (Player 1 Enemy Units Killed score)
however not only does this int store enemy units killed but it stores ANY units killed so i can kill my own units to up my score.
so im pretty much better off just writing my own kill counter script from scratch.
@cinicraft
Well if you want to write it from scratch this should work:
Kill Count
Events
Unit - Any Unit dies
Local Variables
Conditions
(Killing unit) == Unit
(Player (Triggering player) treats player (Killing player) as Ally) == false
Actions
Variable - Set Unit Kills = (Unit Kills + 1)
It checks to make sure that the unit doing the killing is the one you want to up the kill count of, and that the killed unit is not an ally, then increases it's score variable.
EDIT: Woops, SquarelyCircle was right: the "Unit Kills" variable should have been global rather than local.
@Shinoogie12: Go
whoa, whoa, whoa. Don't use a local variable for this, or it will disappear when the trigger ends.
Suterusu has a good example, and SquarelyCircle is right, you would want to create a global integer variable for this, not local.
Overkill, just call PlayerScoreValueGetAsInt in the leaderboard update function.