# Save Data Table Value (Trigger)

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

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

Returns — void

native void DataTableSetTrigger(
	bool global,
	string name,
	trigger val,
);

Category: Data Table / Save Value

# Examples

campaigns/swarmstoryutil.sc2modbase.sc2data/Lib281DEC45.galaxy:5724

void lib281DEC45_gf_SetScriptedSceneCallback (string lp_scene, trigger lp_callback) {
    // Implementation
    DataTableSetTrigger(true, (lib281DEC45_gv_zSS_ScriptedScenePrefix + (lp_scene)), lp_callback);
}

campaigns/voidstory.sc2campaignbase.sc2data/TriggerLibs/VoidCampaignStoryLib.galaxy:4545

    // Automatic Variable Declarations
    // Implementation
    DataTableSetTrigger(true, (libVCST_gv_pSC_ScriptedScenePrefix + (lp_scene)), lp_callback);
}

mods/missionpacks/novacampaign.sc2modbase.sc2data/LibNCST.galaxy:3893

void libNCST_gf_RegisterStorymodeScene (string lp_scene, trigger lp_callback) {
    // Implementation
    DataTableSetTrigger(true, (libNCST_gv_nSC_ScriptedScenePrefix + (lp_scene)), lp_callback);
}

mods/starcoop/starcoop.sc2modbase.sc2data/LibCOMU.galaxy:275

    // Automatic Variable Declarations
    // Implementation
    DataTableSetTrigger(true, ("CT_SD_" + (lp_mutator)), lp_shutdownTrigger);
}

mods/starcoop/starcoop.sc2modbase.sc2data/LibCOMU.galaxy:281

    // Automatic Variable Declarations
    // Implementation
    DataTableSetTrigger(true, ("CT_IN_" + (lp_mutator)), lp_initTrigger);
    DataTableSetTrigger(true, ("CT_SD_" + (lp_mutator)), lp_shutdownTrigger);
}

mods/starcoop/starcoop.sc2modbase.sc2data/LibCOMU.galaxy:282

    // Implementation
    DataTableSetTrigger(true, ("CT_IN_" + (lp_mutator)), lp_initTrigger);
    DataTableSetTrigger(true, ("CT_SD_" + (lp_mutator)), lp_shutdownTrigger);
}