# Convert String To Ability Command
Grammar — Ability Command(val|String)
Flags —Native
|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);
# Related
Category: Conversion / Basic Conversions
- Convert String To Text —
text
— StringToText - Convert Game Link To String
- Convert String To Game Link
- Convert String To Catalog Entry
- Convert String To Catalog Reference
- Convert String To Catalog Field Name
- Convert String To Catalog Field Path
- Convert String To Catalog Scope
- Convert Catalog Entry To String
- Convert Catalog Reference To String
- Convert Catalog Reference (Any -> Numeric)
- Convert Catalog Reference (Any -> Upgrade)
- Convert Catalog Reference (Upgrade -> Any)
- Convert Catalog Reference (Numeric -> Any)
- Convert Catalog Field Name To String
- Convert Catalog Field Path To String
- Convert Catalog Scope To String
- Convert String To Image File
- Convert String To Movie File
- Convert String To Cutscene File
- Convert Conversation State Index To String
- Convert String To Conversation State Index
- Convert User Data Instance To String
- Convert String To User Data Instance
- Convert String To Real —
fixed
— StringToFixed - Convert String To Integer —
int
— StringToInt - Convert String To Ability Command —
abilcmd
— StringToAbilCmd - Convert Real To Text —
text
— FixedToText - Convert Real To Text (Advanced) —
text
— FixedToTextAdvanced - Convert Real To String —
string
— FixedToString - Convert Real To Integer —
int
— FixedToInt - Convert Integer To Text —
text
— IntToText - Convert Integer To String —
string
— IntToString - Convert Integer To Real —
fixed
— IntToFixed - Convert Boolean To Text —
text
— libNtve_gf_ConvertBooleanToText - Convert Boolean To Integer —
int
— BoolToInt - Convert Boolean To String —
string
— libNtve_gf_ConvertBooleanToString - Convert String To Boolean —
bool
— libNtve_gf_ConvertStringToBoolean - Convert Point To String —
string
— libNtve_gf_ConvertPointToString - Convert String To Point —
point
— libNtve_gf_ConvertStringToPoint - Convert Image To String
- Convert Game User To Integer
- Format Number —
text
— FormatNumber - Format Duration —
text
— FormatDuration
# Examples
campaigns/swarmstory.sc2campaign — base.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.sc2campaign — base.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.sc2mod — base.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.sc2mod — base.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.sc2mod — base.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.sc2mod — base.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.sc2mod — base.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.sc2mod — base.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.sc2mod — base.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);