I don't know why, but the units that usually don't have a mineral cost (like the Scientist in my example), even if you put a mineral cost, they return 0 when you call the action Cost of Unit Type.
I tryed to put all the stuff in the data editor the same as other unit, but still doesn't return the mineral cost.
The cost is sometimes in the ability to train units. So go to barracks train >>> marine >>> and you can set up the cost there. So some units might have the price defined there.
Rollback Post to RevisionRollBack
Feel free to Send me a PM if you have any questions/concerns!
I played around with your map and got the tank to work by changing the trigger from "Siege Tank (Siege Mode)" to "Siege Tank (Tank Mode)". Still trying to get the scientist to work though.
I don't know why, but the units that usually don't have a mineral cost (like the Scientist in my example), even if you put a mineral cost, they return 0 when you call the action Cost of Unit Type.
I tryed to put all the stuff in the data editor the same as other unit, but still doesn't return the mineral cost.
This is actually a bug and it's been around since beta. To extract the actual cost field you can use catalog functions.
Variable - Set Value = (Integer((Value of Units (String((Unit type of (Triggering unit)))) "CostResource[Minerals]" for player Any Player)))
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
I don't know why, but the units that usually don't have a mineral cost (like the Scientist in my example), even if you put a mineral cost, they return 0 when you call the action Cost of Unit Type.
I tryed to put all the stuff in the data editor the same as other unit, but still doesn't return the mineral cost.
@fr0d0b0ls0n: Go
Bump.
Example map.
@fr0d0b0ls0n: Go
Bump :(
The cost is sometimes in the ability to train units. So go to barracks train >>> marine >>> and you can set up the cost there. So some units might have the price defined there.
@zeldarules28: Go
You can't train anywhere the units I need to set their mineral cost.
@fr0d0b0ls0n: Go
My last bump.
If nobody knows how to do it, I'll make special code for each of those units >.<
I played around with your map and got the tank to work by changing the trigger from "Siege Tank (Siege Mode)" to "Siege Tank (Tank Mode)". Still trying to get the scientist to work though.
This is actually a bug and it's been around since beta. To extract the actual cost field you can use catalog functions.
Variable - Set Value = (Integer((Value of Units (String((Unit type of (Triggering unit)))) "CostResource[Minerals]" for player Any Player)))