# 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.sc2campaign


// L6324
DataTableSetObjective(true, libSwaC_gf_ZS_ObjectiveTableString(lp_objectiveData), ObjectiveLastCreated())

# campaigns/voidstory.sc2campaign


// L2611
DataTableSetObjective(true, libVoiC_gf_PS_ObjectiveTableString(lp_objectiveData), ObjectiveLastCreated())

# mods/missionpacks/campaigncommon.sc2mod


// L127
DataTableSetObjective(true, libComC_gf_CC_ObjectiveTableString(lp_objectiveData), ObjectiveLastCreated())

# mods/starcoop/starcoop.sc2mod


// L9237
DataTableSetObjective(true, libCOOC_gf_CS_ObjectiveTableString(lp_objectiveData), ObjectiveLastCreated())

# mods/voidprologue.sc2mod


// L4859
DataTableSetObjective(true, libA3DDD02B_gf_PP_ObjectiveTableString(lp_objectiveData), ObjectiveLastCreated())