# Save Data Table Value (Sound)

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

Saves a sound 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
  • sound — Value

Returns — void

native void DataTableSetSound(
	bool global,
	string name,
	sound val,

Category: Data Table / Save Value

# Examples

# campaigns/voidstory.sc2campaign


// L325
DataTableSetSound(true, libVCMI_gf_PM_SoundDataTableName(), SoundLastPlayed())

# mods/heroesdata.stormmod


// L5030
DataTableSetSound(false, TriggerEventParamName(libGame_gv_eventID_AnnouncerVOInitiated_C, libGame_gv_eventParam_Sound_C), lp_sound)

# mods/missionpacks/novacampaign.sc2mod


// L1785
DataTableSetSound(true, libNCMI_gf_NM_SoundDataTableName(), SoundLastPlayed())

# mods/starcoop/starcoop.sc2mod


// L619
DataTableSetSound(true, libCOMI_gf_CM_SoundDataTableName(), SoundLastPlayed())