# Ability Command Producing Unit

Grammar — Identify the ability command at index index that produces unitType
FlagsNative | Function

# Arguments

  • string<gamelink::Unit> — Unit Type
  • int — Index

Returns — abilcmd

native abilcmd TechTreeUnitProducedAbilCmd(
	string unitType,
	int index,
);

Category: Tech Tree / Production

# Examples

mods/heroesdata.stormmodbase.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.sc2modbase.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.sc2modbase.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.sc2modbase.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)) {