(Player Player Minerals) >= (Minerals cost of Items Trinkets[index][(index 2 + 1)])
Player=Triggering player (when a dialog button is used)
Items Trinkets=Unit Type[array][array]
index=interger representing the type of trinket; runs through a loop
index2=integer representing the level of the specific type of trinket, runs through a loop in that loop
(Spare me the lecture on loops in loops; they are small and organized; a failed condition check is .002 MS, on average, .008 ms may be wasted when this trigger runs)
Lets all assume my variables are set properly due to the fact that when I set the condition to require 1000 minerals, everything works perfectly; and eventually this action runs perfectly:
Unit - Create one Items Trinkets[index][(index 2 + 1)] item in the inventory of Hero PlayerHero[Player]
So, I am referencing the same exact unit type, in the same manner a few lines later without altering variables; leading me to the conclusion that the problem must be in that condition.
On the unit type being referenced, the mineral cost is set to 1000.
Anyone got an idea why it may be returning the mineral cost value of a unit would return as zero when i am positive it is set to 1000?
should have waited 20 minutes before looking for help. Though I found no solution, if I set the unit's life and energy to the mineral and vespean costs I am looking for; then reference them instead, it works properly. Clueless as to why their costs would return zero; but with a simple work around, I will chalk it up to "lol, Blizzard, you silly guys you"
(Player Player Minerals) >= (Integer((Items Trinkets[index][(index 2 + 1)] Life Maximum)))
The reason you're having trouble with that condition is because the function "Minerals cost of <unit>" is a piece of crap (as are lots of other built-in functions in the editor).
I didn't get any response in that thread, but I eventually found that the solution is to just use Catalog Value Get functions instead (so in this case, you would look at the CostResource[Minerals] field of the unit type of the unit).
Hope that helps so you don't have to do any other elaborate workarounds.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
(Player Player Minerals) >= (Minerals cost of Items Trinkets[index][(index 2 + 1)])
Player=Triggering player (when a dialog button is used) Items Trinkets=Unit Type[array][array] index=interger representing the type of trinket; runs through a loop index2=integer representing the level of the specific type of trinket, runs through a loop in that loop
(Spare me the lecture on loops in loops; they are small and organized; a failed condition check is .002 MS, on average, .008 ms may be wasted when this trigger runs)
Lets all assume my variables are set properly due to the fact that when I set the condition to require 1000 minerals, everything works perfectly; and eventually this action runs perfectly:
Unit - Create one Items Trinkets[index][(index 2 + 1)] item in the inventory of Hero PlayerHero[Player]
So, I am referencing the same exact unit type, in the same manner a few lines later without altering variables; leading me to the conclusion that the problem must be in that condition.
On the unit type being referenced, the mineral cost is set to 1000.
Anyone got an idea why it may be returning the mineral cost value of a unit would return as zero when i am positive it is set to 1000?
Skype: [email protected] Current Project: Custom Hero Arena! US: battlenet:://starcraft/map/1/263274 EU: battlenet:://starcraft/map/2/186418
should have waited 20 minutes before looking for help. Though I found no solution, if I set the unit's life and energy to the mineral and vespean costs I am looking for; then reference them instead, it works properly. Clueless as to why their costs would return zero; but with a simple work around, I will chalk it up to "lol, Blizzard, you silly guys you"
(Player Player Minerals) >= (Integer((Items Trinkets[index][(index 2 + 1)] Life Maximum)))
Skype: [email protected] Current Project: Custom Hero Arena! US: battlenet:://starcraft/map/1/263274 EU: battlenet:://starcraft/map/2/186418
@GlornII: Go
The reason you're having trouble with that condition is because the function "Minerals cost of <unit>" is a piece of crap (as are lots of other built-in functions in the editor).
Come to think of it, I think my first post on sc2mapster.com was because of that same reason: http://www.sc2mapster.com/forums/development/triggers/31642-unit-type-cost-returning-0/#p1
I didn't get any response in that thread, but I eventually found that the solution is to just use Catalog Value Get functions instead (so in this case, you would look at the CostResource[Minerals] field of the unit type of the unit).
Hope that helps so you don't have to do any other elaborate workarounds.