# Save Data Table Value (Objective)

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

Saves an objective 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
  • int<objective> — Value

Returns — void

native void DataTableSetObjective(
	bool global,
	string name,
	int val,
);

Category: Data Table / Save Value

# Examples

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


    ObjectiveCreate(lv_name, libSwaC_gf_MissionObjectiveDescription(lp_objectiveData), c_objectiveStateActive, libSwaC_gf_ZS_GetObjectiveTypeBoolean(lp_objectiveData));
    DataTableSetObjective(true, libSwaC_gf_ZS_ObjectiveTableString(lp_objectiveData), ObjectiveLastCreated());
    libSwaC_gf_ZS_SetObjectiveProgressData(lp_objectiveData, 0, false);
}

campaigns/voidstory.sc2campaignbase.sc2data/TriggerLibs/VoidCampaignMissionLib.galaxy:2611


    ObjectiveCreate(lv_name, libVoiC_gf_MissionObjectiveDescription(lp_objectiveData), c_objectiveStateActive, libVoiC_gf_PS_GetObjectiveTypeBoolean(lp_objectiveData));
    DataTableSetObjective(true, libVoiC_gf_PS_ObjectiveTableString(lp_objectiveData), ObjectiveLastCreated());
    if ((libVoiC_gf_PS_ObjectiveCountsDown(lp_objectiveData) == false)) {
        libVCMI_gf_SetMissionObjectiveProgress(lp_objectiveData, 0);

mods/missionpacks/campaigncommon.sc2modbase.sc2data/LibCMMI.galaxy:127


    ObjectiveCreate(lv_name, libComC_gf_MissionObjectiveDescription(lp_objectiveData), c_objectiveStateActive, libComC_gf_CC_ObjectiveTypeBoolean(lp_objectiveData));
    DataTableSetObjective(true, libComC_gf_CC_ObjectiveTableString(lp_objectiveData), ObjectiveLastCreated());
    if ((libComC_gf_CC_ObjectiveCountsDown(lp_objectiveData) == false)) {
        libCMMI_gf_SetMissionObjectiveProgress(lp_objectiveData, 0);

mods/starcoop/starcoop.sc2modbase.sc2data/LibCOMI.galaxy:9266

    lv_bonusText = libCOOC_gf_CS_CampaignObjectiveBonusText(lp_objectiveData);
    ObjectiveCreate(lv_name, libCOOC_gf_MissionObjectiveDescription(lp_objectiveData), c_objectiveStateActive, libCOOC_gf_CS_GetObjectiveTypeBoolean(lp_objectiveData));
    DataTableSetObjective(true, libCOOC_gf_CS_ObjectiveTableString(lp_objectiveData), ObjectiveLastCreated());
    if ((libCOOC_gf_CS_ObjectiveCountsDown(lp_objectiveData) == false)) {
        if ((libCOOC_gf_MissionObjectiveItemCount(lp_objectiveData) == 1)) {

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


    ObjectiveCreate(lv_name, libA3DDD02B_gf_MissionObjectiveDescription(lp_objectiveData), c_objectiveStateActive, libA3DDD02B_gf_PP_GetObjectiveTypeBoolean(lp_objectiveData));
    DataTableSetObjective(true, libA3DDD02B_gf_PP_ObjectiveTableString(lp_objectiveData), ObjectiveLastCreated());
    libA3DDD02B_gf_PP_MissionObjectiveProgressDataSet(lp_objectiveData, 0, false);
}