# Save Data Table Value (String)

Grammar — Save value as name in the scope|Global/Local data table
FlagsNative | Action

Saves a string value into a data table. Data tables allow you to store and recall values using a string identifier. If you save a data table value using a string identifier that already exists, you will overwrite the old value, even if it is a different data type than the value you are saving.

# Arguments

  • bool [ preset::DataScope ] — Scope
  • string — Name
  • string — Value

Returns — void

native void DataTableSetString(
	bool global,
	string name,
	string val,
);

Category: Data Table / Save Value

# Examples

# campaigns/libertystory.sc2campaign

CampaignLib.galaxy

// L8023
DataTableSetString(true, libCamp_gf_TS_HelpUnitsPanel_UnitTypeStringID(lp_unitType), IntToString(libCamp_gv_tSX_HelpUnitsPanel_EnabledUnitTypesCount))

# campaigns/swarmstory.sc2campaign

SwarmCampaignLib.galaxy

// L487
DataTableSetString(true, lv_name, lp_dataID)
// L4412
DataTableSetString(true, lv_dataTableName, "1")
// L7267
DataTableSetString(true, libSwaC_gf_ZS_HelpUnitsPanel_UnitTypeStringID(lp_unitType), IntToString(libSwaC_gv_zSX_HelpUnitsPanel_EnabledUnitTypesCount))

# campaigns/swarmstoryutil.sc2mod

Lib281DEC45.galaxy

// L6040
DataTableSetString(true, lib281DEC45_gf_ZSS_UIArchivesDataString(BattleReportLastCreated()), (lv_mission))
// L6077
DataTableSetString(true, lib281DEC45_gf_ZSS_UIArchivesDataString(BattleReportLastCreated()), (lv_mission))
// L6089
DataTableSetString(true, lib281DEC45_gf_ZSS_UIArchivesDataString(BattleReportLastCreated()), ("Scenes" + ";" + (lv_scene)))

# campaigns/voidstory.sc2campaign

VoidCampaignLib.galaxy

// L1601
DataTableSetString(true, lv_dataTableName, "1")
// L6053
DataTableSetString(true, libVoiC_gf_PS_HelpUnitsPanel_UnitTypeStringID(lp_unitType), IntToString(libVoiC_gv_pCX_HelpUnitPanel_EnabledUnitTypeCount))
// L8455
DataTableSetString(true, lv_name, lp_dataID)

# campaigns/voidstory.sc2campaign

VoidCampaignMissionLib.galaxy

// L6511
DataTableSetString(true, ("PS_" + TriggerGetFunction(libVCMI_gv_pM_MissionCheat_Cheats[lv_dialogIndex].lv_trigger)), lv_editBoxValue)
// L6566
DataTableSetString(true, ("PS_" + TriggerGetFunction(libVCMI_gv_pM_MissionCheat_Cheats[lv_iter].lv_trigger)), StringWord(EventChatMessage(false), 2))

# campaigns/voidstory.sc2campaign

VoidCampaignStoryLib.galaxy

// L3570
DataTableSetString(true, (libVCST_gv_pSC_REDIRECTPREFIX + (lp_sourceCharacter)), ("Clickable;" + (lp_targetClickable)))

# campaigns/voidstory.sc2campaign

VoidCampaignUILib.galaxy

// L4370
DataTableSetString(true, libVCUI_gf_PU_ProgressBarUnit_DataNameOld(lp_unit, libVCUI_ge_PU_ProgressBarUnitStoredValuesOld_Attachment), (lp_attachment))
// L6998
DataTableSetString(true, libVCUI_gf_PU_ArchivesDataString(BattleReportLastCreated()), (lv_indexMission))
// L7016
DataTableSetString(true, libVCUI_gf_PU_ArchivesDataString(BattleReportLastCreated()), ("Scenes;" + (lv_indexScene)))

# mods/heroesdata.stormmod

GameLib.galaxy

// L2565
DataTableSetString(false, TriggerEventParamName(libGame_gv_eventID_MapSpecificAwardInitialize_C, libGame_gv_eventParam_MapSpecificAwardInitialize_BadgeIndex_C), lp_badgeIndex)
// L2566
DataTableSetString(false, TriggerEventParamName(libGame_gv_eventID_MapSpecificAwardInitialize_C, libGame_gv_eventParam_MapSpecificAwardInitialize_ScoreValue_C), (lp_scoreValue))
// L2578
DataTableSetString(false, TriggerEventParamName(libGame_gv_eventID_MapSpecificAwardInitialize_C, libGame_gv_eventParam_MapSpecificAwardInitialize_BadgeIndex_C), UserDataGetString("EndOfMatchMapSpecificAward", lp_userData, "Award Badge Index", 1))
// L2579
DataTableSetString(false, TriggerEventParamName(libGame_gv_eventID_MapSpecificAwardInitialize_C, libGame_gv_eventParam_MapSpecificAwardInitialize_ScoreValue_C), (UserDataGetGameLink("EndOfMatchMapSpecificAward", lp_userData, "Score Value Boolean", 1)))
// L4155
DataTableSetString(false, TriggerEventParamName(libGame_gv_eventID_HeroGainTalent_C, libGame_gv_eventParam_HeroGainTalent_Gained_Talent), lp_GainedTalent)
// L4445
DataTableSetString(false, TriggerEventParamName(libGame_gv_eventID_MapMechanicInit_C, libGame_gv_eventParam_MapMechanicInit_Mechanic_C), lp_mechanic)
// L5070
DataTableSetString(false, TriggerEventParamName(libGame_gv_eventID_CustomKillVO_C, libGame_gv_eventParam_CustomKillVOKillLine_C), (lp_killLine))

# mods/heroesdata.stormmod

HeroesLib.galaxy

// L541
DataTableSetString(true, ("HeroIndex_" + IntToString(lp_heroIndex) + "_SkinIndex_" + IntToString(lv_newSkinCount)), (lp_skinLink))
// L589
DataTableSetString(true, ("HeroIndex_" + lv_heroIndexStr), lv_heroID)
// L596
DataTableSetString(true, ("HeroIndex_" + lv_heroIndexStr + "_MountCategoryIndex_" + IntToString(DataTableGetInt(true, lv_mountCategoryCountStr))), lv_mountCategoryID)
// L599
DataTableSetString(true, ("HeroIndex_" + lv_heroIndexStr + "_SkinIndex_" + IntToString(1)), "Default")
// L611
DataTableSetString(true, ("HeroIndex_" + lv_heroIndexStr + "_MountCategoryIndex_" + IntToString(DataTableGetInt(true, lv_mountCategoryCountStr))), lv_mountCategoryID)
// L627
DataTableSetString(true, ("HeroIndex_" + lv_heroIndexStr + "_VoiceLineIndex_" + IntToString(DataTableGetInt(true, lv_voiceLineCountStr))), lv_voiceLineID)
// L1648
DataTableSetString(true, (lv_mountDataTableStr + "_ID"), lv_mountLinkStr)
// L1652
DataTableSetString(true, ("MountIndex_" + IntToString(libCore_gv_dataMountsMountCount)), lv_mountLinkStr)
// L4329
DataTableSetString(true, ("SprayIndex_" + IntToString(libCore_gv_loot_SprayCount)), lv_sprayID)
// L4367
DataTableSetString(true, ("BannerIndex_" + IntToString(libCore_gv_loot_BannerCount)), lv_bannerID)

# mods/heroesdata.stormmod

SupportLib.galaxy

// L474
DataTableSetString(true, ("DMGStatTrackPlayer" + lv_reportPlayerAsStr + ":Effect" + IntToString(lv_itEntry)), "")
// L497
DataTableSetString(true, ("HLGStatTrackPlayer" + lv_reportPlayerAsStr + ":Effect" + IntToString(lv_itEntry)), "")
// L2499
DataTableSetString(true, ("DMGStatTrackPlayer" + lv_damagingEffectPlayerAsStr + ":Effect" + IntToString(DataTableGetInt(true, ("DMGStatTrackPlayer" + lv_damagingEffectPlayerAsStr + ":EffectInstanceCount")))), lv_damagingEffectName)
// L2584
DataTableSetString(true, ("HLGStatTrackPlayer" + lv_healingEffectPlayerAsStr + ":Effect" + IntToString(DataTableGetInt(true, ("HLGStatTrackPlayer" + lv_healingEffectPlayerAsStr + ":EffectInstanceCount")))), lv_healingEffectName)

# mods/heroesdata.stormmod

UILib.galaxy

// L2366
DataTableSetString(true, ("DEBUG_AnnouncerVOSoundLink_Player_" + IntToString(lp_player) + "_ListIndex_" + IntToString(lv_listIndex) + "_SoundID"), lv_entry)
// L2404
DataTableSetString(true, ("DEBUG_AnnouncerVOSoundLink_Player_" + IntToString(lp_player) + "_ListIndex_" + IntToString(lv_listIndex) + "_SoundID"), lv_soundID)
// L10871
DataTableSetString(true, ("DEBUG_SoundVOPlayBox_Player_" + IntToString(lv_triggeringPlayer) + "_ListIndex_" + IntToString(DialogControlGetItemCount(lv_listRight, lv_triggeringPlayer)) + "_SoundID"), lv_soundID)

# mods/missionpacks/campaigncommon.sc2mod

LibComC.galaxy

// L92
DataTableSetString(true, lv_dataTableName, "1")

# mods/missionpacks/novacampaign.sc2mod

LibNCMI.galaxy

// L5451
DataTableSetString(true, ("NS_" + TriggerGetFunction(libNCMI_gv_NM_MissionCheat_Cheats[lv_dialogIndex].lv_trigger)), lv_editBoxValue)
// L5507
DataTableSetString(true, ("NS_" + TriggerGetFunction(libNCMI_gv_NM_MissionCheat_Cheats[lv_iter].lv_trigger)), StringWord(EventChatMessage(false), 2))

# mods/missionpacks/novacampaign.sc2mod

LibNCST.galaxy

// L3048
DataTableSetString(true, (libNCST_gv_nSC_REDIRECTPREFIX + (lp_sourceCharacter)), ("Clickable;" + (lp_targetClickable)))

# mods/missionpacks/novacampaign.sc2mod

LibNCUI.galaxy

// L4241
DataTableSetString(true, libNCUI_gf_NU_ArchivesDataString(BattleReportLastCreated()), (lv_indexMission))
// L4259
DataTableSetString(true, libNCUI_gf_NU_ArchivesDataString(BattleReportLastCreated()), ("Scenes;" + (lv_indexScene)))

# mods/missionpacks/novacampaign.sc2mod

LibNovC.galaxy

// L620
DataTableSetString(true, ("DebugTechSaveTechItem_" + (lv_indexTechItem)), (libNovC_gf_NC_ArmyTechItemAssignedUnit(lv_indexTechItem)))

# mods/starcoop/starcoop.sc2mod

LibCOMI.galaxy

// L2746
DataTableSetString(libCOMI_gv_cMC_CoopAI_AttackForce_DataTableScope, libCOMI_gf_CM_CoopAI_AttackForce_GetDataTableName_Unit(lp_index), (lp_unitType))
// L25123
DataTableSetString(false, TriggerEventParamName(lv_event, "EventHeroInstance"), (lv_heroInstance))

# mods/starcoop/starcoop.sc2mod

LibCOMU.galaxy

// L4175
DataTableSetString(true, ("CT_CorpseType_" + IntToString(lv_corpseIndex)), (UnitGetType(lp_deadUnit)))
// L4190
DataTableSetString(true, ("CT_CorpseType_" + IntToString(lp_corpseIndex)), (libCOMU_gf_CT_CorpseUnitType(libCOMU_gv_cT_CorpseCount)))
// L6644
DataTableSetString(true, ("CT_ResType_" + IntToString(UnitGetTag(lv_indexResource))), ("MineralFieldMinerals"))
// L6648
DataTableSetString(true, ("CT_ResType_" + IntToString(UnitGetTag(lv_indexResource))), ("MineralFieldMinerals750"))
// L6652
DataTableSetString(true, ("CT_ResType_" + IntToString(UnitGetTag(lv_indexResource))), ("HighYieldMineralFieldMinerals"))
// L6656
DataTableSetString(true, ("CT_ResType_" + IntToString(UnitGetTag(lv_indexResource))), ("HighYieldMineralFieldMinerals750"))
// L6660
DataTableSetString(true, ("CT_ResType_" + IntToString(UnitGetTag(lv_indexResource))), ("MineralFieldMineralsNoRemove"))

# mods/starcoop/starcoop.sc2mod

LibCOOC.galaxy

// L5120
DataTableSetString(true, ("CC_ScoreType_" + IntToString(libCOOC_gv_cC_ScoreTrackedDmgTakenCount)), (lp_scoreType))
// L5558
DataTableSetString(true, lv_name, lp_dataID)

# mods/starcoop/starcoop.sc2mod

LibCOUI.galaxy

// L3451
DataTableSetString(true, libCOUI_gf_CU_ProgressBarUnit_DataNameOld(lp_unit, libCOUI_ge_CU_ProgressBarUnitStoredValuesOld_Attachment), (lp_attachment))

# mods/voidprologue.sc2mod

LibA3DDD02B.galaxy

// L3229
DataTableSetString(true, lv_dataTableName, "1")
// L5435
DataTableSetString(true, libA3DDD02B_gf_PP_HelpUnitPanel_EnabledUnitTypeStringID(lp_unitType), IntToString(libA3DDD02B_gv_pPX_HelpUnitPanel_EnabledUnitTypeCount))
// L9653
DataTableSetString(true, libA3DDD02B_gf_PP_ArchivesDataString(BattleReportLastCreated()), (lv_indexMission))
// L9669
DataTableSetString(true, libA3DDD02B_gf_PP_ArchivesDataString(BattleReportLastCreated()), ("Scenes;" + (lv_indexScene)))

# mods/warcoop/warcoopdata.sc2mod

WarCoopData.galaxy

// L3046
DataTableSetString(false, TriggerEventParamName(lv_eventname, ("Param" + IntToString(lv_numberofparameters))), lv_nextword)
// L3053
DataTableSetString(false, TriggerEventParamName(lv_eventname, "Cheat"), lv_chatcheatstring)