# Convert String To Ability Command

Grammar — Ability Command(val|String)
FlagsNative | Function

Converts a string value to an ability command value. This is primarily for use with catalog fields that store ability commands.

# Arguments

  • string — Value

Returns — abilcmd

native abilcmd StringToAbilCmd(string x);

Category: Conversion / Basic Conversions

# Examples

campaigns/swarmstory.sc2campaignbase.sc2data/TriggerLibs/SwarmCampaignLib.galaxy:7086

    lv_index = 1;
    for ( ; ( (auto68552800_ai >= 0 && lv_index <= auto68552800_ae) || (auto68552800_ai < 0 && lv_index >= auto68552800_ae) ) ; lv_index += auto68552800_ai ) {
        lv_abilityCommand = StringToAbilCmd(libSwaC_gf_ZS_CatalogGetFieldArrayValue(lp_catalog, lp_entry, lv_aField, lv_index, lp_player));
        if ((lp_enableDisable == true)) {
            TechTreeAbilityAllow(lp_player, lv_abilityCommand, true);

campaigns/voidstory.sc2campaignbase.sc2data/TriggerLibs/VoidCampaignLib.galaxy:6391

    lv_index = 1;
    for ( ; ( (auto1BF728AC_ai >= 0 && lv_index <= auto1BF728AC_ae) || (auto1BF728AC_ai < 0 && lv_index >= auto1BF728AC_ae) ) ; lv_index += auto1BF728AC_ai ) {
        lv_abilityCommand = StringToAbilCmd(libVoiC_gf_PC_CatalogGetFieldArrayValue(lp_catalog, lp_entry, lv_aField, lv_index, lp_player));
        if ((lp_enableDisable == true)) {
            TechTreeAbilityAllow(lp_player, lv_abilityCommand, true);

mods/core.sc2modbase.sc2data/TriggerLibs/NativeLib.galaxy:141

        lv_classId = CatalogEntryClass(c_gameCatalogAbil, CatalogFieldValueGet(c_gameCatalogItem, lv_itemType, "Abil", UnitGetOwner(lv_otherUnit)));
        if (((lv_classId == c_classIdCAbilEffectTarget) || (lv_classId == c_classIdCAbilEffectInstant))) {
            lv_abilUsed = StringToAbilCmd(CatalogFieldValueGet(c_gameCatalogItem, lv_itemType, "Abil", UnitGetOwner(lv_otherUnit)));
        }

mods/missionpacks/campaigncommon.sc2modbase.sc2data/LibComC.galaxy:1985

    lv_index = 1;
    for ( ; ( (auto454C61AE_ai >= 0 && lv_index <= auto454C61AE_ae) || (auto454C61AE_ai <= 0 && lv_index >= auto454C61AE_ae) ) ; lv_index += auto454C61AE_ai ) {
        lv_abilityCommand = StringToAbilCmd(libComC_gf_CC_CatalogGetFieldArrayValue(lp_catalog, lp_entry, lv_aField, lv_index, lp_player));
        if ((lp_enableDisable == true)) {
            TechTreeAbilityAllow(lp_player, lv_abilityCommand, true);

mods/starcoop/starcoop.sc2modbase.sc2data/LibCOOC.galaxy:4268

    lv_index = 1;
    for ( ; ( (auto1BF728AC_ai >= 0 && lv_index <= auto1BF728AC_ae) || (auto1BF728AC_ai < 0 && lv_index >= auto1BF728AC_ae) ) ; lv_index += auto1BF728AC_ai ) {
        lv_abilityCommand = StringToAbilCmd(libCOOC_gf_CC_CatalogGetFieldArrayValue(lp_catalog, lp_entry, lv_aField, lv_index, lp_player));
        if ((lp_enableDisable == true)) {
            if ((libCOOC_gv_cC_DebugTechSuperSpam == true)) {

mods/starcoop/starcoop.sc2modbase.sc2data/LibCOOC.galaxy:4271

        if ((lp_enableDisable == true)) {
            if ((libCOOC_gv_cC_DebugTechSuperSpam == true)) {
                TextExpressionSetToken("Param/Expression/lib_COOC_0692D816", "A", StringToText((AbilityCommandGetAbility(StringToAbilCmd(libCOOC_gf_CC_CatalogGetFieldArrayValue(lp_catalog, lp_entry, lv_aField, lv_index, lp_player))))));
                TextExpressionSetToken("Param/Expression/lib_COOC_0692D816", "B", libNtve_gf_ConvertBooleanToText(true));
                TriggerDebugOutput(1, TextExpressionAssemble("Param/Expression/lib_COOC_0692D816"), true);

mods/starcoop/starcoop.sc2modbase.sc2data/LibCOOC.galaxy:4280

        else {
            if ((libCOOC_gv_cC_DebugTechSuperSpam == true)) {
                TextExpressionSetToken("Param/Expression/lib_COOC_3030B119", "A", StringToText((AbilityCommandGetAbility(StringToAbilCmd(libCOOC_gf_CC_CatalogGetFieldArrayValue(lp_catalog, lp_entry, lv_aField, lv_index, lp_player))))));
                TextExpressionSetToken("Param/Expression/lib_COOC_3030B119", "B", libNtve_gf_ConvertBooleanToText(false));
                TriggerDebugOutput(1, TextExpressionAssemble("Param/Expression/lib_COOC_3030B119"), true);

mods/starcoop/starcoop.sc2modbase.sc2data/LibCOUI.galaxy:4659

            lv_path = ("CardLayouts[" + IntToString(lv_cardIndex) + "].LayoutButtons[" + IntToString(lv_buttonIndex) + "]");
            if ((CatalogFieldValueGet(c_gameCatalogUnit, "SoACaster", ((lv_path + ".Type")), lp_player) == "AbilCmd") && (CatalogFieldValueGetAsInt(c_gameCatalogUnit, "SoACaster", ((lv_path + ".Row")), lp_player) == 0) && (CatalogFieldValueGetAsInt(c_gameCatalogUnit, "SoACaster", ((lv_path + ".Column")), lp_player) == (lp_slot-1))) {
                lv_command = StringToAbilCmd(CatalogFieldValueGet(c_gameCatalogUnit, "SoACaster", ((lv_path + ".AbilCmd")), lp_player));
                if ((TechTreeAbilityIsAllowed(lp_player, lv_command) == true)) {
                    return lv_command;

mods/voidprologue.sc2modbase.sc2data/LibA3DDD02B.galaxy:5334

    lv_index = 1;
    for ( ; ( (auto68552800_ai >= 0 && lv_index <= auto68552800_ae) || (auto68552800_ai < 0 && lv_index >= auto68552800_ae) ) ; lv_index += auto68552800_ai ) {
        lv_abilityCommand = StringToAbilCmd(libA3DDD02B_gf_PP_CatalogGetFieldArrayValue(lp_catalog, lp_entry, lv_aField, lv_index, lp_player));
        if ((lp_enableDisable == true)) {
            TechTreeAbilityAllow(lp_player, lv_abilityCommand, true);