# Ability Command Producing Unit
Grammar — Identify the ability command at index index that produces unitType
Flags —Native
|Function
# Arguments
string
<gamelink::Unit> — Unit Typeint
— Index
Returns — abilcmd
native abilcmd TechTreeUnitProducedAbilCmd(
string unitType,
int index,
);
# Related
Category: Tech Tree / Production
- Ability Command Producing Unit —
abilcmd
— TechTreeUnitProducedAbilCmd - Ability Command Count Producing Unit —
int
— TechTreeUnitProducedAbilCmdCount - Unit Which Produces Unit —
string
<gamelink::Unit> — TechTreeUnitProducesUnit - Unit Which Produces Unit Count —
int
— TechTreeUnitProducesUnitCount - Unit Which Produces Upgrade —
string
<gamelink::Upgrade> — TechTreeUnitProducesUpgrade - Unit Which Produces Upgrade Count —
int
— TechTreeUnitProducesUpgradeCount - Ability Command Producing Upgrade —
abilcmd
— TechTreeUpgradeProducedAbilCmd - Ability Command Count Producing Unit —
int
— TechTreeUpgradeProducedAbilCmdCount
# Examples
mods/heroesdata.stormmod — base.stormdata/TriggerLibs/GameLib.galaxy:1970
lv_unitTypeAsString = (UnitGetType(libGame_gv_players[lv_effectingPlayer].lv_heroUnit));
if ((lv_effectingUnitType != UnitGetType(libGame_gv_players[lv_effectingPlayer].lv_heroUnit)) && (((UnitTypeTestAttribute(lv_effectingUnitType, c_unitAttributeSummoned) == true) && (CatalogFieldValueGet(c_gameCatalogUnit, lv_effectingUnitType, "LeaderAlias", c_playerAny) != lv_unitTypeAsString)) || ((UnitTypeTestAttribute(lv_effectingUnitType, c_unitAttributeSummoned) == false) && (CatalogFieldValueGet(c_gameCatalogUnit, lv_effectingUnitType, "LeaderAlias", c_playerAny) == lv_unitTypeAsString)))) {
lv_effectHistoryEntryAbility = AbilityCommandGetAbility(TechTreeUnitProducedAbilCmd(lv_effectingUnitType, 0));
if ((lv_sourceButton == null)) {
lv_sourceButton = (CatalogFieldValueGet(c_gameCatalogAbil, lv_effectHistoryEntryAbility, "CmdButtonArray[" + IntToString(0) + "].DefaultButtonFace", c_playerAny));
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOMI.galaxy:6030
lv_i = 0;
for ( ; ( (auto3D8DE2E4_ai >= 0 && lv_i <= auto3D8DE2E4_ae) || (auto3D8DE2E4_ai < 0 && lv_i >= auto3D8DE2E4_ae) ) ; lv_i += auto3D8DE2E4_ai ) {
lv_cmd = TechTreeUnitProducedAbilCmd(lv_uT, lv_i);
lv_abil = AbilityCommandGetAbility(lv_cmd);
lv_abilIndex = AbilityCommandGetCommand(lv_cmd);
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOMI.galaxy:24112
lv_i = 0;
for ( ; ( (auto160BF7D1_ai >= 0 && lv_i <= auto160BF7D1_ae) || (auto160BF7D1_ai < 0 && lv_i >= auto160BF7D1_ae) ) ; lv_i += auto160BF7D1_ai ) {
lv_cmd = TechTreeUnitProducedAbilCmd(lv_ut, lv_i);
lv_order = Order(lv_cmd);
if ((UnitOrderIsValid(lv_sCV, lv_order) == false)) {
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOMI.galaxy:24183
lv_i = 0;
for ( ; ( (auto3A2F8F84_ai >= 0 && lv_i <= auto3A2F8F84_ae) || (auto3A2F8F84_ai < 0 && lv_i >= auto3A2F8F84_ae) ) ; lv_i += auto3A2F8F84_ai ) {
lv_cmd = TechTreeUnitProducedAbilCmd(lv_ut, lv_i);
lv_order = Order(lv_cmd);
if ((UnitOrderIsValid(lv_sCV, lv_order) == false)) {