I can't find where a units supply cost is exposed in the Trigger Editor.
Here...
<<code galaxy>>
const int c_unitPropSuppliesUsed = 12; Read-only
const int c_unitPropSuppliesMade = 13; Read-only
native int UnitGetPropertyInt (unit inUnit, int inProp, bool inCurrent);
native fixed UnitGetPropertyFixed (unit inUnit, int inProp, bool inCurrent);
<</code>
In GUI it should be under unit properties. If not then you need to use Galaxy script to get it. The above declarations from the native fire can be used and called to do it.
If that is not sufficient you can read the supply cost directly from the unit type using the catalog functions/natives.
Quote:
Also what is the most elegant way to pass that kind of variable into an effect, I don't want to make 6+ identical effects if I don't have to.
You cannot pass trigger values directly to data effects. You can use catalog actions/native calls to immediately modify a dummy data effect with the required amount (if it is persistent it might have strange results during changes, use for immediate effects only). Catalog natives modify the same fields as upgrades so have the same limitations as far as what they can change (not what they can read, they can read all but editor only fields).
Generally the recommended approach in this situation would be to trigger the effect fully. For example use the create unit actions/native call to generate the number of Zerglings you want. This might be less efficient however it is the only way to handle non-standard logic.
I can't find where a units supply cost is exposed in the Trigger Editor.
I'm trying to craft a trigger that spawns X zerglings for the player when they kill any enemy unit, where X is equal to the killed units supply cost.
Also what is the most elegant way to pass that kind of variable into an effect, I don't want to make 6+ identical effects if I don't have to.
Here...
<<code galaxy>>
const int c_unitPropSuppliesUsed = 12; Read-only const int c_unitPropSuppliesMade = 13; Read-onlynative int UnitGetPropertyInt (unit inUnit, int inProp, bool inCurrent); native fixed UnitGetPropertyFixed (unit inUnit, int inProp, bool inCurrent); <</code> In GUI it should be under unit properties. If not then you need to use Galaxy script to get it. The above declarations from the native fire can be used and called to do it.
If that is not sufficient you can read the supply cost directly from the unit type using the catalog functions/natives.
You cannot pass trigger values directly to data effects. You can use catalog actions/native calls to immediately modify a dummy data effect with the required amount (if it is persistent it might have strange results during changes, use for immediate effects only). Catalog natives modify the same fields as upgrades so have the same limitations as far as what they can change (not what they can read, they can read all but editor only fields).
Generally the recommended approach in this situation would be to trigger the effect fully. For example use the create unit actions/native call to generate the number of Zerglings you want. This might be less efficient however it is the only way to handle non-standard logic.
@ImperialGood: Go
Thanks for the insight
The easiest way is to use a action/function with "unit property" in the name. You can get supply stuff from there.