# Save Data Table Value (Timer)

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

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

Returns — void

native void DataTableSetTimer(
	bool global,
	string name,
	timer val,
);

Category: Data Table / Save Value

# Examples

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

    // Implementation
    if ((DataTableGetTimer(true, libCOOC_gf_CS_ObjectiveTableString(lp_objective)) != lp_timer)) {
        DataTableSetTimer(true, libCOMI_gf_CM_ObjectiveTimer(lp_objective), lp_timer);
        libCOMI_gf_CM_UpdateObjectiveTimerCampaign(lp_objective);
    }

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

    UnitGroupAdd(libCOMU_gv_cT_VoidRifts, UnitLastCreated());
    libCOMU_gf_CT_RegisterSpawnedUnit(UnitLastCreated());
    DataTableSetTimer(true, ("RiftTimer" + IntToString(libCOMU_gv_cT_VoidRiftCount)), TimerCreate());
    TimerStart(DataTableGetTimer(true, ("RiftTimer" + IntToString(libCOMU_gv_cT_VoidRiftCount))), libCOMI_gf_DifficultyValueFixed2(libCOMI_gf_DifficultyLevelForPlayerCoop(lp_forPlayer), 90.0, 70.0, 45.0, 30.0, 30.0, 30.0), false, c_timeAI);
    DataTableSetTimer(true, ("RiftTrickleTimer" + IntToString(libCOMU_gv_cT_VoidRiftCount)), TimerCreate());

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

    DataTableSetTimer(true, ("RiftTimer" + IntToString(libCOMU_gv_cT_VoidRiftCount)), TimerCreate());
    TimerStart(DataTableGetTimer(true, ("RiftTimer" + IntToString(libCOMU_gv_cT_VoidRiftCount))), libCOMI_gf_DifficultyValueFixed2(libCOMI_gf_DifficultyLevelForPlayerCoop(lp_forPlayer), 90.0, 70.0, 45.0, 30.0, 30.0, 30.0), false, c_timeAI);
    DataTableSetTimer(true, ("RiftTrickleTimer" + IntToString(libCOMU_gv_cT_VoidRiftCount)), TimerCreate());
    TimerStart(DataTableGetTimer(true, ("RiftTrickleTimer" + IntToString(libCOMU_gv_cT_VoidRiftCount))), libCOMI_gf_DifficultyValueFixed2(libCOMI_gf_DifficultyLevelForPlayerCoop(lp_forPlayer), 20.0, 18.0, 13.0, 10.0, 10.0, 10.0), false, c_timeAI);
}

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

                libNtve_gf_StopTimer(lv_riftTimer);
                libNtve_gf_StopTimer(lv_riftTrickleTimer);
                DataTableSetTimer(true, ("RiftTimer" + IntToString(FixedToInt(UnitGetCustomValue(lv_rift, 0)))), null);
                DataTableSetTimer(true, ("RiftTrickleTimer" + IntToString(FixedToInt(UnitGetCustomValue(lv_rift, 0)))), null);
                UnitGroupRemove(libCOMU_gv_cT_VoidRifts, lv_rift);

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

                libNtve_gf_StopTimer(lv_riftTrickleTimer);
                DataTableSetTimer(true, ("RiftTimer" + IntToString(FixedToInt(UnitGetCustomValue(lv_rift, 0)))), null);
                DataTableSetTimer(true, ("RiftTrickleTimer" + IntToString(FixedToInt(UnitGetCustomValue(lv_rift, 0)))), null);
                UnitGroupRemove(libCOMU_gv_cT_VoidRifts, lv_rift);
                continue;