I'm trying to create a trigger that displays the cost of items when selected. The cost has been already set for the unit being the item, but for some reason the value is returning as 0. Does anyone know why?
For some reason when I put it into some kind of buying / training ability, then it wouldn't do that.
@DarkForce9999:
I don't know about items, but if they do work like units, you must know that cost is referenced through 2 fields : one in unit tab, and one in the ability that makes it available.
Example : the unit Marine and the ability Barrack (train) both use a field to define marine's cost. And they both work and stack.
I don't know about items, but if they do work like units, you must know that cost is referenced through 2 fields : one in unit tab, and one in the ability that makes it available.
Example : the unit Marine and the ability Barrack (train) both use a field to define marine's cost. And they both work and stack.
I know, but for some reason if I were not to add the item into buying/training, and if I were to use the trigger to get the unit cost, it would come out as 0. I'm only bypassing it by creating a training ability that has all the items I wanted to show.
@DarkForce9999:
Maybe it's the only way then!
Research elements have no cost on their own. Maybe items are alike in the way that you need to set cost with an ability.
I tried using the catalog functions, and it took me a while to figure out how exactly to do it. It was an educational experience, but I imagine some people just want the answer right now.
Something I ran into was that the catalog wants a string as entry, but UnitGetType returns a UnitType. (Which is a string, but the GUI doesn't know).
Also, the fieldpath for Catalog is "CostResource[Minerals]", not "CostResource[0]".
I'm trying to create a trigger that displays the cost of items when selected. The cost has been already set for the unit being the item, but for some reason the value is returning as 0. Does anyone know why?
For some reason when I put it into some kind of buying / training ability, then it wouldn't do that.
I know, but for some reason if I were not to add the item into buying/training, and if I were to use the trigger to get the unit cost, it would come out as 0. I'm only bypassing it by creating a training ability that has all the items I wanted to show.
It's a known bug. Use catalog functions to get the cost as a workaround.
@RileyStarcraft: Go
I tried using the catalog functions, and it took me a while to figure out how exactly to do it. It was an educational experience, but I imagine some people just want the answer right now.
Anyway, for people looking for a quick fix:
Try using Real for Catalog Field Value Get :)