# Unit Type Cost

GrammarinCostType cost of inUnitType
FlagsNative | Function

Returns the cost of a unit type.

# Arguments

  • string [ gamelink::Unit ] — Unit Type
  • int [ preset::UnitCostType ] — Resource Type

Returns — int

native int UnitTypeGetCost(
	string inUnitType,
	int inCostType,
);

Category: Unit / Properties

# Examples

# campaigns/liberty.sc2campaign

MapScript.galaxy

// L547
UnitTypeGetCost("Nexus", c_unitCostMinerals)
// L547
UnitTypeGetCost("Nexus", c_unitCostMinerals)
// L2723
UnitTypeGetCost("SpineCrawler", c_unitCostMinerals)
// L2723
UnitTypeGetCost("SpineCrawler", c_unitCostMinerals)

# campaigns/voidstory.sc2campaign

VoidCampaignLib.galaxy

// L10690
UnitTypeGetCost(UnitGetType(EventUnitCreatedUnit()), c_unitCostMinerals)
// L10692
UnitTypeGetCost(UnitGetType(EventUnitCreatedUnit()), c_unitCostVespene)
// L10750
UnitTypeGetCost(UnitGetType(EventUnit()), c_unitCostMinerals)
// L10753
UnitTypeGetCost(UnitGetType(EventUnit()), c_unitCostVespene)
// L10867
UnitTypeGetCost(UnitGetType(EventUnit()), c_unitCostMinerals)
// L10869
UnitTypeGetCost(UnitGetType(EventUnit()), c_unitCostVespene)

# mods/starcoop/starcoop.sc2mod

LibCOMI.galaxy

// L91
UnitTypeGetCost("Supplicant", c_unitCostMinerals)
// L2091
UnitTypeGetCost(lv_unitTypeToCreate, c_unitCostSumMineralsVespene)
// L2188
UnitTypeGetCost(lv_unitTypeToCreate, c_unitCostSumMineralsVespene)
// L2642
UnitTypeGetCost(lv_unitTypesForWave[lv_unitPercentBaseIter], c_unitCostSumMineralsVespene)
// L2643
UnitTypeGetCost(lv_unitTypesForWave[lv_unitPercentBaseIter], c_unitCostSumMineralsVespene)
// L2654
UnitTypeGetCost(lv_unitTypesForWave[lv_unitPercentBaseIter], c_unitCostSumMineralsVespene)
// L2690
UnitTypeGetCost(lv_randomUnitType, c_unitCostSumMineralsVespene)
// L2694
UnitTypeGetCost(lv_randomUnitType, c_unitCostSumMineralsVespene)
// L2699
UnitTypeGetCost(lv_randomUnitType, c_unitCostSumMineralsVespene)
// L2998
UnitTypeGetCost(lv_unitTypesForWave[lv_unitPercentBaseIter], c_unitCostSumMineralsVespene)

# mods/starcoop/starcoop.sc2mod

LibCOMU.galaxy

// L1184
UnitTypeGetCost(UnitGetType(lp_orderedUnit), c_unitCostVespene)
// L4400
UnitTypeGetCost(lv_spawnType, c_unitCostMinerals)
// L4401
UnitTypeGetCost(lv_spawnType, c_unitCostVespene)