# 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.sc2campaignbase.sc2maps/maps/campaign/swarm/zexpedition02.sc2map/MapScript.galaxy:731

    // Automatic Variable Declarations
    // Implementation
    DataTableSetUnitGroup(true, ("EscortShuttles_" + IntToString(UnitGetTag(lp_escort))), lp_shuttles);
    DataTableSetUnit(true, ("EscortShuttle_" + IntToString(UnitGetTag(lp_escort))), UnitGroupUnit(lp_shuttles, 1));
    DataTableSetUnitGroup(true, ("ShuttleEscorts_" + IntToString(UnitGetTag(UnitGroupUnit(lp_shuttles, 1)))), lp_allEscorts);

campaigns/swarm.sc2campaignbase.sc2maps/maps/campaign/swarm/zexpedition02.sc2map/MapScript.galaxy:733

    DataTableSetUnitGroup(true, ("EscortShuttles_" + IntToString(UnitGetTag(lp_escort))), lp_shuttles);
    DataTableSetUnit(true, ("EscortShuttle_" + IntToString(UnitGetTag(lp_escort))), UnitGroupUnit(lp_shuttles, 1));
    DataTableSetUnitGroup(true, ("ShuttleEscorts_" + IntToString(UnitGetTag(UnitGroupUnit(lp_shuttles, 1)))), lp_allEscorts);
}

campaigns/swarm.sc2campaign/base.sc2maps/maps/campaign/swarm/zexpedition02.sc2mapMapScript.galaxy:731

    // Automatic Variable Declarations
    // Implementation
    DataTableSetUnitGroup(true, ("EscortShuttles_" + IntToString(UnitGetTag(lp_escort))), lp_shuttles);
    DataTableSetUnit(true, ("EscortShuttle_" + IntToString(UnitGetTag(lp_escort))), UnitGroupUnit(lp_shuttles, 1));
    DataTableSetUnitGroup(true, ("ShuttleEscorts_" + IntToString(UnitGetTag(UnitGroupUnit(lp_shuttles, 1)))), lp_allEscorts);

campaigns/swarm.sc2campaign/base.sc2maps/maps/campaign/swarm/zexpedition02.sc2mapMapScript.galaxy:733

    DataTableSetUnitGroup(true, ("EscortShuttles_" + IntToString(UnitGetTag(lp_escort))), lp_shuttles);
    DataTableSetUnit(true, ("EscortShuttle_" + IntToString(UnitGetTag(lp_escort))), UnitGroupUnit(lp_shuttles, 1));
    DataTableSetUnitGroup(true, ("ShuttleEscorts_" + IntToString(UnitGetTag(UnitGroupUnit(lp_shuttles, 1)))), lp_allEscorts);
}

campaigns/swarmstory.sc2campaignbase.sc2data/TriggerLibs/SwarmCampaignLib.galaxy:1196

    PointSetFacing(lv_dropLocation, PointGetFacing(lp_location));
    lv_dropUnits = UnitGroupCopy(lp_units);
    DataTableSetUnitGroup(false, libSwaC_gf__LastDroppedUnitsDataTableName(), lv_dropUnits);
    autoAA5D5DC6_val = lp_race;
    if (autoAA5D5DC6_val == libSwaC_ge_DropPodRace_Terran) {

campaigns/swarmstory.sc2campaignbase.sc2data/TriggerLibs/SwarmCampaignLib.galaxy:1232

    libSwaC_gv__TP_ZergDropPod_Building = UnitLastCreated();
    libNtve_gf_ShowHideUnit(UnitLastCreated(), false);
    DataTableSetUnitGroup(false, libSwaC_gf__LastDroppedUnitsDataTableName(), UnitLastCreatedGroup());
    auto0E9D82BE_val = lp_waitDontWait;
    if (auto0E9D82BE_val == true) {

campaigns/voidstory.sc2campaignbase.sc2data/TriggerLibs/VoidCampaignMissionLib.galaxy:3222

    PointSetFacing(lv_dropLocation, PointGetFacing(lp_location));
    lv_dropUnits = UnitGroupCopy(lp_units);
    DataTableSetUnitGroup(false, libVCMI_gf_PM_DropPod_LastDroppedUnitsDataTableName(), lv_dropUnits);
    auto30FEF00B_val = lp_race;
    if (auto30FEF00B_val == libVCMI_ge_DropPodRace_Terran) {

campaigns/voidstory.sc2campaignbase.sc2data/TriggerLibs/VoidCampaignMissionLib.galaxy:3258

    libVCMI_gv_pM_DropPod_TP_ZergBuilding = UnitLastCreated();
    libNtve_gf_ShowHideUnit(UnitLastCreated(), false);
    DataTableSetUnitGroup(false, libVCMI_gf_PM_DropPod_LastDroppedUnitsDataTableName(), UnitLastCreatedGroup());
    autoFAF09496_val = lp_waitDontWait;
    if (autoFAF09496_val == true) {

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

    // Automatic Variable Declarations
    // Implementation
    DataTableSetUnitGroup(false, TriggerEventParamName(libGame_gv_eventID_MapUnderworldOpen_C, libGame_gv_eventParam_MapUnderworldOpen_Entrances_C), lp_entrances);
    DataTableSetRegion(false, TriggerEventParamName(libGame_gv_eventID_MapUnderworldOpen_C, libGame_gv_eventParam_MapUnderworldOpen_Underworld_C), lp_underworld);
    DataTableSetInt(false, TriggerEventParamName(libGame_gv_eventID_MapUnderworldOpen_C, libGame_gv_eventParam_MapUnderworldOpen_TotalSkull_C), lp_totalSkull);

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

    // Automatic Variable Declarations
    // Implementation
    DataTableSetUnitGroup(false, TriggerEventParamName(libGame_gv_eventID_MinionGroupCreated_C, libGame_gv_eventParam_MinionGroupCreated_C), lp_unitGroup);
    TriggerSendEvent(libGame_gv_eventID_MinionGroupCreated_C);
}

mods/heroesdata.stormmodbase.stormdata/TriggerLibs/HeroesLib.galaxy:3403

    // Automatic Variable Declarations
    // Implementation
    DataTableSetUnitGroup(true, libCore_gf__UnitDataName(libCore_ge__UnitDataType_UnitGroup, lp_unit, lp_index), lp_value);
}

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

    PointSetFacing(lv_dropLocation, PointGetFacing(lp_location));
    lv_dropUnits = UnitGroupCopy(lp_units);
    DataTableSetUnitGroup(false, libNCMI_gf_NM_DropPod_LastDroppedUnitsDataTableName(), lv_dropUnits);
    auto30FEF00B_val = lp_race;
    if (auto30FEF00B_val == libNCMI_ge_DropPodRace_Terran) {

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

    libNCMI_gv_NM_DropPod_TP_ZergBuilding = UnitLastCreated();
    libNtve_gf_ShowHideUnit(UnitLastCreated(), false);
    DataTableSetUnitGroup(false, libNCMI_gf_NM_DropPod_LastDroppedUnitsDataTableName(), UnitLastCreatedGroup());
    autoFAF09496_val = lp_waitDontWait;
    if (autoFAF09496_val == true) {

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

    }
    libCOMI_gf_CM_CoopAI_AttackForce_ClearTable();
    DataTableSetUnitGroup(libCOMI_gv_cMC_CoopAI_AttackForce_DataTableScope, libCOMI_gf_CM_CoopAI_AttackForce_ForceName(), lv_attackForce);
    DataTableSetPoint(libCOMI_gv_cMC_CoopAI_AttackForce_DataTableScope, libCOMI_gf_CM_CoopAI_AttackForce_GatherPointName(), lp_spawnLocation);
    if ((lp_dropWarpin == true)) {

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

    }
    libCOMI_gf_CM_CoopAI_AttackForce_ClearTable();
    DataTableSetUnitGroup(libCOMI_gv_cMC_CoopAI_AttackForce_DataTableScope, libCOMI_gf_CM_CoopAI_AttackForce_ForceName(), lv_attackForce);
}

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

    PointSetFacing(lv_dropLocation, PointGetFacing(lp_location));
    lv_dropUnits = UnitGroupCopy(lp_units);
    DataTableSetUnitGroup(false, libCOMI_gf_CM_DropPod_LastDroppedUnitsDataTableName(), lv_dropUnits);
    auto30FEF00B_val = lp_race;
    if (auto30FEF00B_val == libCOMI_ge_DropPodRace_Terran) {

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

    libCOMI_gv_cM_DropPod_TP_ZergBuilding = UnitLastCreated();
    libNtve_gf_ShowHideUnit(UnitLastCreated(), false);
    DataTableSetUnitGroup(false, libCOMI_gf_CM_DropPod_LastDroppedUnitsDataTableName(), UnitLastCreatedGroup());
    autoFAF09496_val = lp_waitDontWait;
    if (autoFAF09496_val == true) {

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

        UnitGroupAddUnitGroup(lv_attackUnits, UnitLastCreatedGroup());
    }
    DataTableSetUnitGroup(true, ("CT_GiftAtk_" + IntToString(UnitGetTag(lp_gift))), lv_attackUnits);
    AISetGroupScriptControlled(lv_attackUnits, false);
    auto399DB06C_g = lv_attackUnits;

mods/starcoop/starcoop.sc2modbase.sc2data/LibCOOC.galaxy:5121

    UnitGroupAdd(lv_scoreGroup, lp_trackedUnit);
    DataTableSetString(true, ("CC_ScoreType_" + IntToString(libCOOC_gv_cC_ScoreTrackedDmgTakenCount)), (lp_scoreType));
    DataTableSetUnitGroup(true, ("CC_ScoreGroup_" + IntToString(libCOOC_gv_cC_ScoreTrackedDmgTakenCount)), lv_scoreGroup);
    TriggerEnable(libCOOC_gt_CC_ScoreDynDmgTaken, true);
}

mods/voidprologue.sc2modbase.sc2data/LibA3DDD02B.galaxy:884

    PointSetFacing(lv_dropLocation, PointGetFacing(lp_location));
    lv_dropUnits = UnitGroupCopy(lp_units);
    DataTableSetUnitGroup(false, libA3DDD02B_gf__LastDroppedUnitsDataTableName(), lv_dropUnits);
    autoAA5D5DC6_val = lp_race;
    if (autoAA5D5DC6_val == libA3DDD02B_ge_DropPodRace_Terran) {

mods/voidprologue.sc2modbase.sc2data/LibA3DDD02B.galaxy:920

    libA3DDD02B_gv__TP_ZergDropPod_Building = UnitLastCreated();
    libNtve_gf_ShowHideUnit(UnitLastCreated(), false);
    DataTableSetUnitGroup(false, libA3DDD02B_gf__LastDroppedUnitsDataTableName(), UnitLastCreatedGroup());
    auto0E9D82BE_val = lp_waitDontWait;
    if (auto0E9D82BE_val == true) {