# 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.sc2campaignbase.sc2data/TriggerLibs/VoidCampaignMissionLib.galaxy:325

    SoundPlay(lp_soundLink, lp_players, lp_volume, lp_offset);
    libVCMI_gv_pM_SoundDataTableIndex += 1;
    DataTableSetSound(true, libVCMI_gf_PM_SoundDataTableName(), SoundLastPlayed());
}

mods/heroesdata.stormmodbase.stormdata/TriggerLibs/GameLib.galaxy:5030

    DataTableSetInt(false, TriggerEventParamName(libGame_gv_eventID_AnnouncerVOInitiated_C, libGame_gv_eventParam_AnnouncerEvent_C), lp_announcerEvent);
    DataTableSetInt(false, TriggerEventParamName(libGame_gv_eventID_AnnouncerVOInitiated_C, libGame_gv_eventParam_Player_C), lp_player);
    DataTableSetSound(false, TriggerEventParamName(libGame_gv_eventID_AnnouncerVOInitiated_C, libGame_gv_eventParam_Sound_C), lp_sound);
    TriggerSendEvent(libGame_gv_eventID_AnnouncerVOInitiated_C);
}

mods/missionpacks/novacampaign.sc2modbase.sc2data/LibNCMI.galaxy:1785

    SoundPlay(lp_soundLink, lp_players, lp_volume, lp_offset);
    libNCMI_gv_NM_SoundDataTableIndex += 1;
    DataTableSetSound(true, libNCMI_gf_NM_SoundDataTableName(), SoundLastPlayed());
}

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

    SoundPlay(lp_soundLink, lp_players, lp_volume, lp_offset);
    libCOMI_gv_cM_SoundDataTableIndex += 1;
    DataTableSetSound(true, libCOMI_gf_CM_SoundDataTableName(), SoundLastPlayed());
}