# Clear Control Group
Grammar — Clear control group controlGroup|Group Number for player player
Flags —Native
|Action
Removes all units from a control group for a player.
# Arguments
int
— Playerint
— Control Group
Returns — void
native void UnitControlGroupClear(
int inPlayer,
int inGroup,
);
# Related
Category: Selection / Control Groups
- Control Group Units —
unitgroup
— UnitControlGroup - Copy Unit Control Groups —
void
— libNtve_gf_CopyUnitControlGroups - Add Unit To Control Group —
void
— UnitControlGroupAddUnit - Add Unit Group To Control Group —
void
— UnitControlGroupAddUnits - Remove Unit From Control Group —
void
— UnitControlGroupRemoveUnit - Remove Unit Group From Control Group —
void
— UnitControlGroupRemoveUnits - Clear Control Group —
void
— UnitControlGroupClear
# Examples
campaigns/swarm.sc2campaign — base.sc2maps/maps/campaign/swarm/zhybrid03.sc2map/MapScript.galaxy:5380
auto9CE5C92E_var = 0;
for ( ; auto9CE5C92E_var <= auto9CE5C92E_ae; auto9CE5C92E_var += 1 ) {
UnitControlGroupClear(gv_pLAYER_01_USER, auto9CE5C92E_var);
}
auto3C6CB8F5_g = UnitGroup(null, gv_pLAYER_01_USER, RegionEntireMap(), UnitFilter(0, 0, (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32))), 0);
campaigns/swarm.sc2campaign/base.sc2maps/maps/campaign/swarm/zhybrid03.sc2map — MapScript.galaxy:5380
auto9CE5C92E_var = 0;
for ( ; auto9CE5C92E_var <= auto9CE5C92E_ae; auto9CE5C92E_var += 1 ) {
UnitControlGroupClear(gv_pLAYER_01_USER, auto9CE5C92E_var);
}
auto3C6CB8F5_g = UnitGroup(null, gv_pLAYER_01_USER, RegionEntireMap(), UnitFilter(0, 0, (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32))), 0);
mods/heroesdata.stormmod — base.stormdata/TriggerLibs/GameDataHelperLib.galaxy:1864
}
UnitControlGroupClear(lv_lVPlayer, 3);
UnitControlGroupAddUnit(lv_lVPlayer, 3, lp_viking);
UnitControlGroupRemoveUnit(lv_lVPlayer, 4, libGDHL_gv_lostVikingsPlayer[lv_lVPlayer].lv_erikGravestone);
mods/heroesdata.stormmod — base.stormdata/TriggerLibs/GameDataHelperLib.galaxy:1884
}
UnitControlGroupClear(lv_lVPlayer, 2);
UnitControlGroupAddUnit(lv_lVPlayer, 2, lp_viking);
UnitControlGroupRemoveUnit(lv_lVPlayer, 4, libGDHL_gv_lostVikingsPlayer[lv_lVPlayer].lv_baleogGravestone);
mods/heroesdata.stormmod — base.stormdata/TriggerLibs/GameDataHelperLib.galaxy:1900
}
UnitControlGroupClear(lv_lVPlayer, 1);
UnitControlGroupAddUnit(lv_lVPlayer, 1, lp_viking);
UnitControlGroupRemoveUnit(lv_lVPlayer, 4, libGDHL_gv_lostVikingsPlayer[lv_lVPlayer].lv_olafGravestone);
mods/heroesdata.stormmod — base.stormdata/TriggerLibs/GameDataHelperLib.galaxy:13024
UISetDragSelectEnabled(PlayerGroupSingle(lv_lVPlayer), true);
UISetFrameVisible(PlayerGroupSingle(lv_lVPlayer), c_syncFrameTypeControlGroupPanel, true);
UnitControlGroupClear(lv_lVPlayer, 1);
UnitControlGroupClear(lv_lVPlayer, 2);
UnitControlGroupClear(lv_lVPlayer, 3);
mods/heroesdata.stormmod — base.stormdata/TriggerLibs/GameDataHelperLib.galaxy:13025
UISetFrameVisible(PlayerGroupSingle(lv_lVPlayer), c_syncFrameTypeControlGroupPanel, true);
UnitControlGroupClear(lv_lVPlayer, 1);
UnitControlGroupClear(lv_lVPlayer, 2);
UnitControlGroupClear(lv_lVPlayer, 3);
UnitControlGroupClear(lv_lVPlayer, 4);
mods/heroesdata.stormmod — base.stormdata/TriggerLibs/GameDataHelperLib.galaxy:13026
UnitControlGroupClear(lv_lVPlayer, 1);
UnitControlGroupClear(lv_lVPlayer, 2);
UnitControlGroupClear(lv_lVPlayer, 3);
UnitControlGroupClear(lv_lVPlayer, 4);
libNtve_gf_CreateUnitsAtPoint2(1, "HeroOlaf", 0, lv_lVPlayer, PointWithOffsetPolar(UnitGetPosition(lv_lVController), 1.5, 240.0), null);
mods/heroesdata.stormmod — base.stormdata/TriggerLibs/GameDataHelperLib.galaxy:13027
UnitControlGroupClear(lv_lVPlayer, 2);
UnitControlGroupClear(lv_lVPlayer, 3);
UnitControlGroupClear(lv_lVPlayer, 4);
libNtve_gf_CreateUnitsAtPoint2(1, "HeroOlaf", 0, lv_lVPlayer, PointWithOffsetPolar(UnitGetPosition(lv_lVController), 1.5, 240.0), null);
libAIAI_gf_AITeamDelegateModifyHeroStatusTokensforTeam(libAIAI_ge_AITeamDelegateAddRemoveLaneValue_Add, libGDHL_gv_aIHeroDelegateTokenValueVikingValue, libGame_gf_TeamNumberOfPlayer(lv_lVPlayer), libAIAI_ge_AITeamDelegateLivingDeadHeroStatusUpdates_HeroAlive);
mods/heromods/samuro.stormmod — base.stormdata/LibHSAM.galaxy:498
}
UnitControlGroupClear(libGame_gf_DebugHeroSwappedPlayer(), 1);
UISetFrameVisible(PlayerGroupSingle(libGame_gf_DebugHeroSwappedPlayer()), c_syncFrameTypeControlGroupPanel, false);
DialogControlSetVisible(libUIUI_gv_uIHeroConsole.lv_heroStatsFrame, libCore_gv_playerGroupFromPlayer[libGame_gf_DebugHeroSwappedPlayer()], true);
mods/heromods/samuro.stormmod — base.stormdata/LibHSAM.galaxy:542
UnitBehaviorRemove(libGame_gv_players[lv_Samuro].lv_heroUnit, "SamuroIllusionMasterToggleAIBehaviorAbil", 1);
UISetFrameVisible(PlayerGroupSingle(lv_Samuro), c_syncFrameTypeControlGroupPanel, false);
UnitControlGroupClear(lv_Samuro, 1);
UnitControlGroupClear(lv_Samuro, 2);
UnitControlGroupClear(lv_Samuro, 3);
mods/heromods/samuro.stormmod — base.stormdata/LibHSAM.galaxy:543
UISetFrameVisible(PlayerGroupSingle(lv_Samuro), c_syncFrameTypeControlGroupPanel, false);
UnitControlGroupClear(lv_Samuro, 1);
UnitControlGroupClear(lv_Samuro, 2);
UnitControlGroupClear(lv_Samuro, 3);
UnitControlGroupClear(lv_Samuro, 4);
mods/heromods/samuro.stormmod — base.stormdata/LibHSAM.galaxy:544
UnitControlGroupClear(lv_Samuro, 1);
UnitControlGroupClear(lv_Samuro, 2);
UnitControlGroupClear(lv_Samuro, 3);
UnitControlGroupClear(lv_Samuro, 4);
return true;
mods/heromods/samuro.stormmod — base.stormdata/LibHSAM.galaxy:545
UnitControlGroupClear(lv_Samuro, 2);
UnitControlGroupClear(lv_Samuro, 3);
UnitControlGroupClear(lv_Samuro, 4);
return true;
}
mods/heromods/samuro.stormmod — base.stormdata/LibHSAM.galaxy:658
UnitSelect(lv_samuroCargoUnit, lv_samuroPlayer, true);
if ((PlayerHasTalent(lv_samuroPlayer, "SamuroHeroicAbilityIllusionMaster") == false)) {
UnitControlGroupClear(lv_samuroPlayer, 1);
UnitControlGroupClear(lv_samuroPlayer, 2);
UnitControlGroupClear(lv_samuroPlayer, 3);
mods/heromods/samuro.stormmod — base.stormdata/LibHSAM.galaxy:659
if ((PlayerHasTalent(lv_samuroPlayer, "SamuroHeroicAbilityIllusionMaster") == false)) {
UnitControlGroupClear(lv_samuroPlayer, 1);
UnitControlGroupClear(lv_samuroPlayer, 2);
UnitControlGroupClear(lv_samuroPlayer, 3);
UnitControlGroupClear(lv_samuroPlayer, 4);
mods/heromods/samuro.stormmod — base.stormdata/LibHSAM.galaxy:660
UnitControlGroupClear(lv_samuroPlayer, 1);
UnitControlGroupClear(lv_samuroPlayer, 2);
UnitControlGroupClear(lv_samuroPlayer, 3);
UnitControlGroupClear(lv_samuroPlayer, 4);
}
mods/heromods/samuro.stormmod — base.stormdata/LibHSAM.galaxy:661
UnitControlGroupClear(lv_samuroPlayer, 2);
UnitControlGroupClear(lv_samuroPlayer, 3);
UnitControlGroupClear(lv_samuroPlayer, 4);
}