I have a custom leaderboard where different units killed amount to different points. I am using the unit cost minerals to determine the "score" of the killed unit. The values have all been set but this is a weird one.. for some reason only firebats, wraiths and medics aren't counting the scores. All other unit types are.
Is there something special about the default settings of these units? The minerals are set and the "Cost Category" is set to Army. Any ides? Here is the trigger fyi:
---
Unit - Any Unit dies
---
If
(Owner of (Killing unit)) == (Player 1 from (Players on team 1))
Then
----
Variable - Modify Player 1 Score: + (Minerals cost of (Unit type of (Triggering unit)))
-----
It's not reading the mineral costs for those previously mentioned units. No clue what it could be.
If i have to that is a viable option, thank you. The only problem is i have a good chunk of other triggers that would be affected and likewise cause tons of rework. Also, i would like to understand the issue itself. Minerals cost of those units returns nothing, but yet there is clearly a mineral cost. That logic makes no sense. Perhaps its something to do with the fact they aren't the default units in melee games, and thus are not returning mineral values for some reason?
Sorry for double post. Another thought relating to the problem.. could it be the map dependencies (campaign, multi, etc)? A though nut to crack here...
For anyone interested, i found a workaround (thanks to this forum actually). Apparently the Minerals Cost method of returning a value is bugged for custom units.. or some certain units.. whatever. Below is the workaround i created, by using an integer variable, set to Catalog Field Value Get .. so i just took the value of the triggering unit directly from the data instead of using the jenky built-in mineral cost lookup thingy. Then i put it in a local variable for my "any unit dies" trigger.
Events
Unit - Any Unit dies
Local Variables
Unit Killed Cost = (Integer((Value of Units (String((Unit type of (Triggering unit)))) "CostResource[Minerals]" for player Any Player))) <Integer>
Then obviously the action was changed to:
Variable - Modify Player 1 Score: + Unit Killed Cost
Seems to work so far... hope this helps someone.
:)
I have a custom leaderboard where different units killed amount to different points. I am using the unit cost minerals to determine the "score" of the killed unit. The values have all been set but this is a weird one.. for some reason only firebats, wraiths and medics aren't counting the scores. All other unit types are.
Is there something special about the default settings of these units? The minerals are set and the "Cost Category" is set to Army. Any ides? Here is the trigger fyi:
---Unit - Any Unit dies---If (Owner of (Killing unit)) == (Player 1 from (Players on team 1)) Then---- Variable - Modify Player 1 Score: + (Minerals cost of (Unit type of (Triggering unit)))-----It's not reading the mineral costs for those previously mentioned units. No clue what it could be.
@themusic246:
Why not just change the Score values in the Unit data? You can set that to be the same as the minerals if you want. No trigger necessary.
@TrenchaunT: Go
If i have to that is a viable option, thank you. The only problem is i have a good chunk of other triggers that would be affected and likewise cause tons of rework. Also, i would like to understand the issue itself. Minerals cost of those units returns nothing, but yet there is clearly a mineral cost. That logic makes no sense. Perhaps its something to do with the fact they aren't the default units in melee games, and thus are not returning mineral values for some reason?
Sorry for double post. Another thought relating to the problem.. could it be the map dependencies (campaign, multi, etc)? A though nut to crack here...
For anyone interested, i found a workaround (thanks to this forum actually). Apparently the Minerals Cost method of returning a value is bugged for custom units.. or some certain units.. whatever. Below is the workaround i created, by using an integer variable, set to Catalog Field Value Get .. so i just took the value of the triggering unit directly from the data instead of using the jenky built-in mineral cost lookup thingy. Then i put it in a local variable for my "any unit dies" trigger.
Events Unit - Any Unit dies Local Variables Unit Killed Cost = (Integer((Value of Units (String((Unit type of (Triggering unit)))) "CostResource[Minerals]" for player Any Player))) <Integer>
Then obviously the action was changed to:
Variable - Modify Player 1 Score: + Unit Killed Cost
Seems to work so far... hope this helps someone. :)
@themusic246:
I was trying to award players the cost of a unit when it dies, and it would fail for some campaign units. Gonna try your method, thanks.
EDIT: worked like a charm :)