# Copy Of Unit Group
Grammar — Copy of group
Flags —Native
|Function
Copies the specified unit group.
# Arguments
unitgroup
— Unit Group
Returns — unitgroup
native unitgroup UnitGroupCopy(unitgroup inGroup);
# Related
Category: Unit Group / Groups
- Add Unit To Unit Group —
void
— UnitGroupAdd - Add Unit Group To Unit Group Old —
void
— libNtve_gf_AddUnitGroupToUnitGroup - Add Unit Group To Unit Group —
void
— UnitGroupAddUnitGroup - Unit Object Group Call For Help —
void
— UnitObjectGroupCallForHelp - Remove Unit From Unit Group —
void
— UnitGroupRemove - Remove Unit Group From Unit Group Old —
void
— libNtve_gf_RemoveUnitGroupFromUnitGroup - Remove Unit Group From Unit Group —
void
— UnitGroupRemoveUnitGroup - Remove All Units From Unit Group —
void
— UnitGroupClear - Pause All Units In Unit Group —
void
— UnitGroupPauseAll - Create Unit Object Group From Unit Group —
int
— UnitObjectGroupFromUnitGroup - Number Of Units In Unit Group —
int
— UnitGroupCount - Unit In Unit Group —
bool
— UnitGroupHasUnit - Unit From Unit Group —
unit
— UnitGroupUnit - Random Unit From Unit Group —
unit
— UnitGroupRandomUnit - Copy Of Unit Group —
unitgroup
— UnitGroupCopy - Closest Unit To Point Old —
unit
— libNtve_gf_ClosestUnitToPoint - Closest Unit To Point —
unit
— UnitGroupClosestToPoint - Center Of Unit Group Old —
point
— libNtve_gf_CenterOfUnitGroup - Center Of Unit Group —
point
— UnitGroupCenterOfGroup
# Examples
campaigns/liberty.sc2campaign — base.sc2maps/maps/campaign/thorner04.sc2map/MapScript.galaxy:434
// Automatic Variable Declarations
// Variable Initialization
lv_attackers = UnitGroupCopy(gv_killTeamAttackers);
lv_medivacs = UnitGroupCopy(gv_killTeamMedivacs);
campaigns/liberty.sc2campaign — base.sc2maps/maps/campaign/thorner04.sc2map/MapScript.galaxy:435
// Variable Initialization
lv_attackers = UnitGroupCopy(gv_killTeamAttackers);
lv_medivacs = UnitGroupCopy(gv_killTeamMedivacs);
// Implementation
campaigns/liberty.sc2campaign/base.sc2maps/maps/campaign/thorner04.sc2map — MapScript.galaxy:434
// Automatic Variable Declarations
// Variable Initialization
lv_attackers = UnitGroupCopy(gv_killTeamAttackers);
lv_medivacs = UnitGroupCopy(gv_killTeamMedivacs);
campaigns/liberty.sc2campaign/base.sc2maps/maps/campaign/thorner04.sc2map — MapScript.galaxy:435
// Variable Initialization
lv_attackers = UnitGroupCopy(gv_killTeamAttackers);
lv_medivacs = UnitGroupCopy(gv_killTeamMedivacs);
// Implementation
campaigns/libertystory.sc2campaign — base.sc2data/TriggerLibs/CampaignLib.galaxy:564
// Implementation
lv_dropLocation = Point(PointGetX(lp_location), PointGetY(lp_location));
lv_dropUnits = UnitGroupCopy(lp_units);
auto64417E0D_val = lp_race;
if (auto64417E0D_val == libCamp_ge_DropPodRace_Terran) {
campaigns/swarm.sc2campaign — base.sc2maps/maps/campaign/swarm/zchar03.sc2map/MapScript.galaxy:635
lv_center = UnitGroupCenterOfGroup(lp_army);
lv_armyLeftGroup = UnitGroupCopy(lp_army);
while ((libNtve_gf_UnitGroupIsDead(lv_armyLeftGroup) == false)) {
lv_startingUnit = UnitGroupUnit(lv_armyLeftGroup, 1);
campaigns/swarm.sc2campaign — base.sc2maps/maps/campaign/swarm/zchar03.sc2map/MapScript.galaxy:673
UnitGroupAdd(lv_clusterGroup, lp_originUnit);
UnitGroupAdd(lv_newGroup, lp_originUnit);
lv_armyLeftGroup = UnitGroupCopy(lp_army);
UnitGroupRemove(lv_armyLeftGroup, lp_originUnit);
while ((libNtve_gf_UnitGroupIsDead(lv_newGroup) == false)) {
campaigns/swarm.sc2campaign — base.sc2maps/maps/campaign/swarm/zspace01.sc2map/MapScript.galaxy:2480
TriggerEnable(TriggerGetCurrent(), false);
gv_mineralClusterMines = UnitGroup("SJCloakedMine", c_playerAny, RegionFromId(31), UnitFilter(0, 0, (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32))), 0);
lv_mines = UnitGroupCopy(gv_mineralClusterMines);
auto1278E0C0_ae = UnitGroupCount(lv_mines, c_unitCountAlive);
lv_index = 1;
campaigns/swarm.sc2campaign — base.sc2maps/maps/campaign/swarm/zzerus01.sc2map/MapScript.galaxy:1793
}
else {
lv_tempGroup = UnitGroupCopy(gv_aIHarvestGroups[lp_harvestIndex]);
autoA62CBCFC_g = lv_tempGroup;
autoA62CBCFC_u = UnitGroupCount(autoA62CBCFC_g, c_unitCountAll);
campaigns/swarm.sc2campaign/base.sc2maps/maps/campaign/swarm/zchar03.sc2map — MapScript.galaxy:635
lv_center = UnitGroupCenterOfGroup(lp_army);
lv_armyLeftGroup = UnitGroupCopy(lp_army);
while ((libNtve_gf_UnitGroupIsDead(lv_armyLeftGroup) == false)) {
lv_startingUnit = UnitGroupUnit(lv_armyLeftGroup, 1);
campaigns/swarm.sc2campaign/base.sc2maps/maps/campaign/swarm/zchar03.sc2map — MapScript.galaxy:673
UnitGroupAdd(lv_clusterGroup, lp_originUnit);
UnitGroupAdd(lv_newGroup, lp_originUnit);
lv_armyLeftGroup = UnitGroupCopy(lp_army);
UnitGroupRemove(lv_armyLeftGroup, lp_originUnit);
while ((libNtve_gf_UnitGroupIsDead(lv_newGroup) == false)) {
campaigns/swarm.sc2campaign/base.sc2maps/maps/campaign/swarm/zspace01.sc2map — MapScript.galaxy:2480
TriggerEnable(TriggerGetCurrent(), false);
gv_mineralClusterMines = UnitGroup("SJCloakedMine", c_playerAny, RegionFromId(31), UnitFilter(0, 0, (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32))), 0);
lv_mines = UnitGroupCopy(gv_mineralClusterMines);
auto1278E0C0_ae = UnitGroupCount(lv_mines, c_unitCountAlive);
lv_index = 1;
campaigns/swarm.sc2campaign/base.sc2maps/maps/campaign/swarm/zzerus01.sc2map — MapScript.galaxy:1793
}
else {
lv_tempGroup = UnitGroupCopy(gv_aIHarvestGroups[lp_harvestIndex]);
autoA62CBCFC_g = lv_tempGroup;
autoA62CBCFC_u = UnitGroupCount(autoA62CBCFC_g, c_unitCountAll);
campaigns/swarmstory.sc2campaign — base.sc2data/TriggerLibs/SwarmCampaignLib.galaxy:1195
lv_dropLocation = Point(PointGetX(lp_location), PointGetY(lp_location));
PointSetFacing(lv_dropLocation, PointGetFacing(lp_location));
lv_dropUnits = UnitGroupCopy(lp_units);
DataTableSetUnitGroup(false, libSwaC_gf__LastDroppedUnitsDataTableName(), lv_dropUnits);
autoAA5D5DC6_val = lp_race;
campaigns/voidstory.sc2campaign — base.sc2data/TriggerLibs/VoidCampaignMissionLib.galaxy:3221
lv_dropLocation = Point(PointGetX(lp_location), PointGetY(lp_location));
PointSetFacing(lv_dropLocation, PointGetFacing(lp_location));
lv_dropUnits = UnitGroupCopy(lp_units);
DataTableSetUnitGroup(false, libVCMI_gf_PM_DropPod_LastDroppedUnitsDataTableName(), lv_dropUnits);
auto30FEF00B_val = lp_race;
mods/heroesbrawlmods/arenamodemods/punisherarena.stormmod — base.stormdata/LibAMPU.galaxy:859
lv_secondCloestHero = null;
if ((lv_closestHero == libAMPU_gv_aRMPunisherPunishedHero)) {
lv_secondCloestHeroGroup = UnitGroupCopy(lv_heroGroup);
UnitGroupRemove(lv_secondCloestHeroGroup, lv_closestHero);
lv_secondCloestHero = UnitGroupClosestToPoint(lv_secondCloestHeroGroup, UnitGetPosition(lv_punisher));
mods/heroesdata.stormmod — base.stormdata/TriggerLibs/GameLib.galaxy:12319
// Variable Initialization
lv_selectedUnits = UnitGroupCopy(UnitGroupSelected(lp_player));
// Implementation
mods/heroesdata.stormmod — base.stormdata/TriggerLibs/GameLib.galaxy:21008
}
}
libGame_gv_players[lv_player].lv_cameraPlayerUnitGroupToFocusOn = UnitGroupCopy(libGame_gv_players[lv_player].lv_heroUnitGroup);
libGame_gf_CameraUpdateCameraForPlayer(lv_player);
}
mods/heroesmapmods/battlegroundmapmods/braxisholdout.stormmod — base.stormdata/LibSCHO.galaxy:829
// Implementation
if ((lp_team == libGame_gv_teamOrderIndex_C)) {
lv_unitGroup = UnitGroupCopy(libSCHO_gv_mMHO_OrderUltralisks);
if ((libSCHO_gv_mMHO_AttackLane == 1)) {
lv_holdingCage = libSCHO_gv_mMHO_HiveCages[1].lv_south;
mods/heroesmapmods/battlegroundmapmods/braxisholdout.stormmod — base.stormdata/LibSCHO.galaxy:838
}
else {
lv_unitGroup = UnitGroupCopy(libSCHO_gv_mMHO_ChaosUltralisks);
if ((libSCHO_gv_mMHO_AttackLane == 2)) {
lv_holdingCage = libSCHO_gv_mMHO_HiveCages[2].lv_south;
mods/heroesmapmods/battlegroundmapmods/braxisholdout.stormmod — base.stormdata/LibSCHO.galaxy:1370
// Implementation
lv_waveGroup = UnitGroupCopy(lp_waveUnits);
auto23860D9C_g = lv_waveGroup;
auto23860D9C_u = UnitGroupCount(auto23860D9C_g, c_unitCountAll);
mods/heroesmapmods/battlegroundmapmods/skytemple.stormmod — base.stormdata/LibMLCP.galaxy:1255
lv_resultCount = lp_count;
if ((lv_resultCount > UnitGroupCount(lp_group, c_unitCountAlive))) {
return UnitGroupCopy(lp_group);
}
mods/heroesmapmods/battlegroundmapmods/skytemple.stormmod — base.stormdata/LibMLCP.galaxy:1258
}
lv_sourceGroup = UnitGroupCopy(lp_group);
while (true) {
if ((lv_resultCount <= 0)) {
mods/missionpacks/novacampaign.sc2mod — base.sc2data/LibNCMI.galaxy:3394
lv_dropLocation = Point(PointGetX(lp_location), PointGetY(lp_location));
PointSetFacing(lv_dropLocation, PointGetFacing(lp_location));
lv_dropUnits = UnitGroupCopy(lp_units);
DataTableSetUnitGroup(false, libNCMI_gf_NM_DropPod_LastDroppedUnitsDataTableName(), lv_dropUnits);
auto30FEF00B_val = lp_race;
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOMI.galaxy:11201
lv_dropLocation = Point(PointGetX(lp_location), PointGetY(lp_location));
PointSetFacing(lv_dropLocation, PointGetFacing(lp_location));
lv_dropUnits = UnitGroupCopy(lp_units);
DataTableSetUnitGroup(false, libCOMI_gf_CM_DropPod_LastDroppedUnitsDataTableName(), lv_dropUnits);
auto30FEF00B_val = lp_race;
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOMI.galaxy:22162
}
if ((lv_veterancount == 0)) {
lv_veteranunits = UnitGroupCopy(libCOMI_gv_cM_Mengsk_XPHungryUnits);
lv_veterancount = UnitGroupCount(lv_veteranunits, c_unitCountAlive);
if ((lv_veterancount == 0)) {
mods/voidprologue.sc2mod — base.sc2data/LibA3DDD02B.galaxy:883
lv_dropLocation = Point(PointGetX(lp_location), PointGetY(lp_location));
PointSetFacing(lv_dropLocation, PointGetFacing(lp_location));
lv_dropUnits = UnitGroupCopy(lp_units);
DataTableSetUnitGroup(false, libA3DDD02B_gf__LastDroppedUnitsDataTableName(), lv_dropUnits);
autoAA5D5DC6_val = lp_race;