# Save Data Table Value (Unit Group)

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

Saves a unit group 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
  • unitgroup — Value

Returns — void

native void DataTableSetUnitGroup(
	bool global,
	string name,
	unitgroup val,
);

Category: Data Table / Save Value

# Examples

# campaigns/swarm.sc2campaign

MapScript.galaxy

// L731
DataTableSetUnitGroup(true, ("EscortShuttles_" + IntToString(UnitGetTag(lp_escort))), lp_shuttles)
// L733
DataTableSetUnitGroup(true, ("ShuttleEscorts_" + IntToString(UnitGetTag(UnitGroupUnit(lp_shuttles, 1)))), lp_allEscorts)
// L731
DataTableSetUnitGroup(true, ("EscortShuttles_" + IntToString(UnitGetTag(lp_escort))), lp_shuttles)
// L733
DataTableSetUnitGroup(true, ("ShuttleEscorts_" + IntToString(UnitGetTag(UnitGroupUnit(lp_shuttles, 1)))), lp_allEscorts)

# campaigns/swarmstory.sc2campaign

SwarmCampaignLib.galaxy

// L1196
DataTableSetUnitGroup(false, libSwaC_gf__LastDroppedUnitsDataTableName(), lv_dropUnits)
// L1232
DataTableSetUnitGroup(false, libSwaC_gf__LastDroppedUnitsDataTableName(), UnitLastCreatedGroup())

# campaigns/voidstory.sc2campaign

VoidCampaignMissionLib.galaxy

// L3222
DataTableSetUnitGroup(false, libVCMI_gf_PM_DropPod_LastDroppedUnitsDataTableName(), lv_dropUnits)
// L3258
DataTableSetUnitGroup(false, libVCMI_gf_PM_DropPod_LastDroppedUnitsDataTableName(), UnitLastCreatedGroup())

# mods/heroesdata.stormmod

GameLib.galaxy

// L4585
DataTableSetUnitGroup(false, TriggerEventParamName(libGame_gv_eventID_MapUnderworldOpen_C, libGame_gv_eventParam_MapUnderworldOpen_Entrances_C), lp_entrances)
// L4926
DataTableSetUnitGroup(false, TriggerEventParamName(libGame_gv_eventID_MinionGroupCreated_C, libGame_gv_eventParam_MinionGroupCreated_C), lp_unitGroup)

# mods/heroesdata.stormmod

HeroesLib.galaxy

// L3403
DataTableSetUnitGroup(true, libCore_gf__UnitDataName(libCore_ge__UnitDataType_UnitGroup, lp_unit, lp_index), lp_value)

# mods/missionpacks/novacampaign.sc2mod

LibNCMI.galaxy

// L3395
DataTableSetUnitGroup(false, libNCMI_gf_NM_DropPod_LastDroppedUnitsDataTableName(), lv_dropUnits)
// L3430
DataTableSetUnitGroup(false, libNCMI_gf_NM_DropPod_LastDroppedUnitsDataTableName(), UnitLastCreatedGroup())

# mods/starcoop/starcoop.sc2mod

LibCOMI.galaxy

// L2110
DataTableSetUnitGroup(libCOMI_gv_cMC_CoopAI_AttackForce_DataTableScope, libCOMI_gf_CM_CoopAI_AttackForce_ForceName(), lv_attackForce)
// L2198
DataTableSetUnitGroup(libCOMI_gv_cMC_CoopAI_AttackForce_DataTableScope, libCOMI_gf_CM_CoopAI_AttackForce_ForceName(), lv_attackForce)
// L11199
DataTableSetUnitGroup(false, libCOMI_gf_CM_DropPod_LastDroppedUnitsDataTableName(), lv_dropUnits)
// L11235
DataTableSetUnitGroup(false, libCOMI_gf_CM_DropPod_LastDroppedUnitsDataTableName(), UnitLastCreatedGroup())

# mods/starcoop/starcoop.sc2mod

LibCOMU.galaxy

// L2777
DataTableSetUnitGroup(true, ("CT_GiftAtk_" + IntToString(UnitGetTag(lp_gift))), lv_attackUnits)

# mods/starcoop/starcoop.sc2mod

LibCOOC.galaxy

// L5121
DataTableSetUnitGroup(true, ("CC_ScoreGroup_" + IntToString(libCOOC_gv_cC_ScoreTrackedDmgTakenCount)), lv_scoreGroup)

# mods/voidprologue.sc2mod

LibA3DDD02B.galaxy

// L884
DataTableSetUnitGroup(false, libA3DDD02B_gf__LastDroppedUnitsDataTableName(), lv_dropUnits)
// L920
DataTableSetUnitGroup(false, libA3DDD02B_gf__LastDroppedUnitsDataTableName(), UnitLastCreatedGroup())