Like in sc1,
how can I easily with only one trigger gather the information how many kills of a specific unit a player has, like "Player X has killed Y Z-Units".
Simplest way could be to increase one of the unit's custom values every time it kills a unit. So when a unit dies, add 1 to the killing unit's custom value 0 (for example) and then you can just get a unit's custom value 0 to see how many units it has killed. The custom values are Reals so you need to do a real to integer conversion.
Simplest way could be to increase one of the unit's custom values every
time it kills a unit. So when a unit dies, add 1 to the killing unit's
custom value 0 (for example) and then you can just get a unit's custom
value 0 to see how many units it has killed. The custom values are Reals
so you need to do a real to integer conversion.
He wants to know how many "zerglings" a player has killed. Not how many a unit has killed.
Youd need a variable to increment every time the player kills a unit of a specific "type"
Rollback Post to RevisionRollBack
Skype
KageNinpo = SN
My Libraries
DialogLeaderboard & TeamSort
My Projects
SPACEWAR Tribute
Infinite TD
Well actually you can use the custom value as it has an index just like an array.
If you would make a trigger that defines a unit type per index number in the custom value you can store the kill count per unit type
Well actually you can use the custom value as it has an index just like
an array.
If you would make a trigger that defines a unit type per index number in
the custom value you can store the kill count per unit type
Why would you increment a value on a unit.... when you can just increment a global variable.... unless you want him to place a unit on the map and its only purpose is to hold a custom value of all the units of that type that has been killled. Thats a dumb way to do it.
Rollback Post to RevisionRollBack
Skype
KageNinpo = SN
My Libraries
DialogLeaderboard & TeamSort
My Projects
SPACEWAR Tribute
Infinite TD
Example?
One thing i can think of maybe is if your unit has killed say 50+ zerglings that the specific unit gains +25% damage to zerglings
But any new unit created of that same type does not get the increase until it has killed 50 itself.
Example?
One thing i can think of maybe is if your unit has killed say 50+
zerglings that the specific unit gains +25% damage to zerglings
But any new unit created of that same type does not get the increase
until it has killed 50 itself.
he was talking about counting how many units a player killed. Not how many a unit has killed.
Rollback Post to RevisionRollBack
Skype
KageNinpo = SN
My Libraries
DialogLeaderboard & TeamSort
My Projects
SPACEWAR Tribute
Infinite TD
So you know how many times you killed say a zergling. What then post it on the leaderboard or something so we can all players can see you killed zerglings? I doubt that will add to any form of game play.
Im thinking one step ahead and going for what would i use this data for and when i think of that then how to gather the data in the most efficient way without creating extra variables.
Unit custom values are there if you want or not. Custom global variable are always an addition to your map and thus reserves memory for actually nothing.
I find it amusing how many people horde up on global variables and arrays and loops that make any real programmer wanna cry.
Please dont try to discredit people giving something extra to really help.
Yeah, it's really the better way to put a unit in the corner and use it's CV instead of variables. Really. You must be a genius, why didn't anybody came up with this trick so far?
You should definitly do a tutorial on this. We are all looking foreward to gather more of your "thinking-ahead"-tricks!
Like in sc1, how can I easily with only one trigger gather the information how many kills of a specific unit a player has, like "Player X has killed Y Z-Units".
Umm you cant. You would have to count this yourself.
Unless its stored some where specific, which I dont believe it is.
Simplest way could be to increase one of the unit's custom values every time it kills a unit. So when a unit dies, add 1 to the killing unit's custom value 0 (for example) and then you can just get a unit's custom value 0 to see how many units it has killed. The custom values are Reals so you need to do a real to integer conversion.
He wants to know how many "zerglings" a player has killed. Not how many a unit has killed.
Youd need a variable to increment every time the player kills a unit of a specific "type"
Well actually you can use the custom value as it has an index just like an array.
If you would make a trigger that defines a unit type per index number in the custom value you can store the kill count per unit type
Why would you increment a value on a unit.... when you can just increment a global variable.... unless you want him to place a unit on the map and its only purpose is to hold a custom value of all the units of that type that has been killled. Thats a dumb way to do it.
Example?
One thing i can think of maybe is if your unit has killed say 50+ zerglings that the specific unit gains +25% damage to zerglings
But any new unit created of that same type does not get the increase until it has killed 50 itself.
he was talking about counting how many units a player killed. Not how many a unit has killed.
So you know how many times you killed say a zergling. What then post it on the leaderboard or something so we can all players can see you killed zerglings? I doubt that will add to any form of game play.
Im thinking one step ahead and going for what would i use this data for and when i think of that then how to gather the data in the most efficient way without creating extra variables.
Unit custom values are there if you want or not. Custom global variable are always an addition to your map and thus reserves memory for actually nothing.
I find it amusing how many people horde up on global variables and arrays and loops that make any real programmer wanna cry.
Please dont try to discredit people giving something extra to really help.
Yeah, it's really the better way to put a unit in the corner and use it's CV instead of variables. Really. You must be a genius, why didn't anybody came up with this trick so far?
You should definitly do a tutorial on this. We are all looking foreward to gather more of your "thinking-ahead"-tricks!
Hope i'm not feeding the troll.