# Remove Unit From Control Group
Grammar — Remove unit from control group controlGroup|Group Number for player player
Flags —Native
|Action
Removes a unit from a control group for a player.
# Arguments
int
— Playerint
— Control Groupunit
— Unit
Returns — void
native void UnitControlGroupRemoveUnit(
int inPlayer,
int inGroup,
unit inUnit,
);
# 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
mods/heroesdata.stormmod — base.stormdata/TriggerLibs/GameDataHelperLib.galaxy:1866
UnitControlGroupClear(lv_lVPlayer, 3);
UnitControlGroupAddUnit(lv_lVPlayer, 3, lp_viking);
UnitControlGroupRemoveUnit(lv_lVPlayer, 4, libGDHL_gv_lostVikingsPlayer[lv_lVPlayer].lv_erikGravestone);
if ((PlayerHasTalent(lv_lVPlayer, "LostVikingsMasterySpyGames") == true)) {
UnitBehaviorAdd(libGDHL_gv_lostVikingsPlayer[lv_lVPlayer].lv_erik, "SpyGamesCooldown", libGDHL_gv_lostVikingsPlayer[lv_lVPlayer].lv_erik, 1);
mods/heroesdata.stormmod — base.stormdata/TriggerLibs/GameDataHelperLib.galaxy:1886
UnitControlGroupClear(lv_lVPlayer, 2);
UnitControlGroupAddUnit(lv_lVPlayer, 2, lp_viking);
UnitControlGroupRemoveUnit(lv_lVPlayer, 4, libGDHL_gv_lostVikingsPlayer[lv_lVPlayer].lv_baleogGravestone);
UnitCreateEffectUnit(libGDHL_gv_lostVikingsPlayer[lv_lVPlayer].lv_baleogGravestone, "LostVikingsGravestoneCopyOrders", libGDHL_gv_lostVikingsPlayer[lv_lVPlayer].lv_baleog);
UnitRemove(libGDHL_gv_lostVikingsPlayer[lv_lVPlayer].lv_baleogGravestone);
mods/heroesdata.stormmod — base.stormdata/TriggerLibs/GameDataHelperLib.galaxy:1902
UnitControlGroupClear(lv_lVPlayer, 1);
UnitControlGroupAddUnit(lv_lVPlayer, 1, lp_viking);
UnitControlGroupRemoveUnit(lv_lVPlayer, 4, libGDHL_gv_lostVikingsPlayer[lv_lVPlayer].lv_olafGravestone);
UnitCreateEffectUnit(libGDHL_gv_lostVikingsPlayer[lv_lVPlayer].lv_olafGravestone, "LostVikingsGravestoneCopyOrders", libGDHL_gv_lostVikingsPlayer[lv_lVPlayer].lv_olaf);
UnitRemove(libGDHL_gv_lostVikingsPlayer[lv_lVPlayer].lv_olafGravestone);
mods/heroesdata.stormmod — base.stormdata/TriggerLibs/GameDataHelperLib.galaxy:13063
UnitControlGroupAddUnit(lv_lVPlayer, 3, UnitLastCreated());
UnitControlGroupAddUnits(lv_lVPlayer, 4, libGame_gv_players[lv_lVPlayer].lv_heroUnitGroup);
UnitControlGroupRemoveUnit(lv_lVPlayer, 4, libGame_gv_players[lv_lVPlayer].lv_heroUnit);
PathCreateForUnit(libCore_gv_playerGroupFromPlayer[lv_lVPlayer], UnitLastCreated());
PathSetVisible(PathLastCreated(), c_pathLocationWorld, false);
mods/heroesdata.stormmod — base.stormdata/TriggerLibs/GameDataHelperLib.galaxy:14074
Wait(0.0625, c_timeGame);
UnitControlGroupAddUnit(lv_lVPlayer, lv_controlGroup, lv_fakeSelectionVehicle);
UnitControlGroupRemoveUnit(lv_lVPlayer, lv_controlGroup, lv_vikingCargoUnit);
UnitControlGroupRemoveUnit(lv_lVPlayer, 4, lv_vikingCargoUnit);
UnitControlGroupAddUnit(lv_lVPlayer, 4, lv_fakeSelectionVehicle);
mods/heroesdata.stormmod — base.stormdata/TriggerLibs/GameDataHelperLib.galaxy:14075
UnitControlGroupAddUnit(lv_lVPlayer, lv_controlGroup, lv_fakeSelectionVehicle);
UnitControlGroupRemoveUnit(lv_lVPlayer, lv_controlGroup, lv_vikingCargoUnit);
UnitControlGroupRemoveUnit(lv_lVPlayer, 4, lv_vikingCargoUnit);
UnitControlGroupAddUnit(lv_lVPlayer, 4, lv_fakeSelectionVehicle);
while ((libNtve_gf_UnitIsInsideTransport(lv_vikingCargoUnit) == true)) {
mods/heroesdata.stormmod — base.stormdata/TriggerLibs/GameDataHelperLib.galaxy:14081
Wait(0.0625, c_timeGame);
}
UnitControlGroupRemoveUnit(lv_lVPlayer, lv_controlGroup, lv_fakeSelectionVehicle);
UnitControlGroupAddUnit(lv_lVPlayer, lv_controlGroup, lv_vikingCargoUnit);
UnitControlGroupAddUnit(lv_lVPlayer, 4, lv_vikingCargoUnit);
mods/heroesdata.stormmod — base.stormdata/TriggerLibs/GameDataHelperLib.galaxy:14084
UnitControlGroupAddUnit(lv_lVPlayer, lv_controlGroup, lv_vikingCargoUnit);
UnitControlGroupAddUnit(lv_lVPlayer, 4, lv_vikingCargoUnit);
UnitControlGroupRemoveUnit(lv_lVPlayer, 4, lv_fakeSelectionVehicle);
if ((UnitIsSelected(lv_fakeSelectionVehicle, lv_lVPlayer) == true)) {
UnitSelect(lv_vikingCargoUnit, lv_lVPlayer, true);
mods/heroesdata.stormmod — base.stormdata/TriggerLibs/GameDataHelperLib.galaxy:14789
if ((lv_olafLoaded == true)) {
AIRemovePlayerUnit(lv_olaf);
UnitControlGroupRemoveUnit(lv_player, 1, lv_olaf);
UnitControlGroupAddUnit(lv_player, 1, lv_boat);
UnitControlGroupAddUnit(lv_player, 4, lv_boat);
mods/heroesdata.stormmod — base.stormdata/TriggerLibs/GameDataHelperLib.galaxy:14796
if ((lv_erikLoaded == true)) {
AIRemovePlayerUnit(lv_erik);
UnitControlGroupRemoveUnit(lv_player, 3, lv_erik);
UnitControlGroupAddUnit(lv_player, 3, lv_boat);
UnitControlGroupAddUnit(lv_player, 4, lv_boat);
mods/heroesdata.stormmod — base.stormdata/TriggerLibs/GameLib.galaxy:12226
UnitControlGroupAddUnit(lp_player, lv_controlGroup, lp_vehicle);
UnitControlGroupAddUnit(lp_player, 4, lp_vehicle);
UnitControlGroupRemoveUnit(lp_player, lv_controlGroup, lp_hero);
UnitControlGroupRemoveUnit(lp_player, 4, lp_hero);
}
mods/heroesdata.stormmod — base.stormdata/TriggerLibs/GameLib.galaxy:12227
UnitControlGroupAddUnit(lp_player, 4, lp_vehicle);
UnitControlGroupRemoveUnit(lp_player, lv_controlGroup, lp_hero);
UnitControlGroupRemoveUnit(lp_player, 4, lp_hero);
}
mods/heroesdata.stormmod — base.stormdata/TriggerLibs/GameLib.galaxy:12249
UnitControlGroupAddUnit(lp_player, lv_controlGroup, lp_hero);
UnitControlGroupAddUnit(lp_player, 4, lp_hero);
UnitControlGroupRemoveUnit(lp_player, lv_controlGroup, lp_vehicle);
UnitControlGroupRemoveUnit(lp_player, 4, lp_vehicle);
}
mods/heroesdata.stormmod — base.stormdata/TriggerLibs/GameLib.galaxy:12250
UnitControlGroupAddUnit(lp_player, 4, lp_hero);
UnitControlGroupRemoveUnit(lp_player, lv_controlGroup, lp_vehicle);
UnitControlGroupRemoveUnit(lp_player, 4, lp_vehicle);
}
mods/heroesdata.stormmod — base.stormdata/TriggerLibs/GameLib.galaxy:12274
UnitControlGroupAddUnit(lp_player, lv_controlGroup, lp_newVehicle);
UnitControlGroupAddUnit(lp_player, 4, lp_newVehicle);
UnitControlGroupRemoveUnit(lp_player, lv_controlGroup, lp_originVehicle);
UnitControlGroupRemoveUnit(lp_player, 4, lp_originVehicle);
}
mods/heroesdata.stormmod — base.stormdata/TriggerLibs/GameLib.galaxy:12275
UnitControlGroupAddUnit(lp_player, 4, lp_newVehicle);
UnitControlGroupRemoveUnit(lp_player, lv_controlGroup, lp_originVehicle);
UnitControlGroupRemoveUnit(lp_player, 4, lp_originVehicle);
}
mods/heroesdata.stormmod — base.stormdata/TriggerLibs/GameLib.galaxy:12283
UnitControlGroupAddUnit(lp_player, 1, lp_vehicle);
UnitControlGroupAddUnit(lp_player, 4, lp_vehicle);
UnitControlGroupRemoveUnit(lp_player, 1, lp_hero);
UnitControlGroupRemoveUnit(lp_player, 4, lp_hero);
UnitBehaviorAdd(lp_vehicle, "SamuroIllusionMasterToggleAIBehaviorAbil", lp_vehicle, 1);
mods/heroesdata.stormmod — base.stormdata/TriggerLibs/GameLib.galaxy:12284
UnitControlGroupAddUnit(lp_player, 4, lp_vehicle);
UnitControlGroupRemoveUnit(lp_player, 1, lp_hero);
UnitControlGroupRemoveUnit(lp_player, 4, lp_hero);
UnitBehaviorAdd(lp_vehicle, "SamuroIllusionMasterToggleAIBehaviorAbil", lp_vehicle, 1);
}
mods/heroesdata.stormmod — base.stormdata/TriggerLibs/GameLib.galaxy:12294
UnitControlGroupAddUnit(lp_player, 1, lp_hero);
UnitControlGroupAddUnit(lp_player, 4, lp_hero);
UnitControlGroupRemoveUnit(lp_player, 1, lp_vehicle);
UnitControlGroupRemoveUnit(lp_player, 4, lp_vehicle);
}
mods/heroesdata.stormmod — base.stormdata/TriggerLibs/GameLib.galaxy:12295
UnitControlGroupAddUnit(lp_player, 4, lp_hero);
UnitControlGroupRemoveUnit(lp_player, 1, lp_vehicle);
UnitControlGroupRemoveUnit(lp_player, 4, lp_vehicle);
}
mods/heromods/samuro.stormmod — base.stormdata/LibHSAM.galaxy:642
}
UnitControlGroupAddUnit(lv_samuroPlayer, lv_controlGroup, lv_fakeSelectionVehicle);
UnitControlGroupRemoveUnit(lv_samuroPlayer, lv_controlGroup, lv_samuroCargoUnit);
UnitControlGroupRemoveUnit(lv_samuroPlayer, 4, lv_samuroCargoUnit);
UnitControlGroupAddUnit(lv_samuroPlayer, 4, lv_fakeSelectionVehicle);
mods/heromods/samuro.stormmod — base.stormdata/LibHSAM.galaxy:643
UnitControlGroupAddUnit(lv_samuroPlayer, lv_controlGroup, lv_fakeSelectionVehicle);
UnitControlGroupRemoveUnit(lv_samuroPlayer, lv_controlGroup, lv_samuroCargoUnit);
UnitControlGroupRemoveUnit(lv_samuroPlayer, 4, lv_samuroCargoUnit);
UnitControlGroupAddUnit(lv_samuroPlayer, 4, lv_fakeSelectionVehicle);
while ((libNtve_gf_UnitIsInsideTransport(lv_samuroCargoUnit) == true)) {
mods/heromods/samuro.stormmod — base.stormdata/LibHSAM.galaxy:651
UnitSelect(lv_transportUnit, lv_samuroPlayer, false);
UnitSelect(lv_fakeSelectionVehicle, lv_samuroPlayer, false);
UnitControlGroupRemoveUnit(lv_samuroPlayer, lv_controlGroup, lv_fakeSelectionVehicle);
UnitControlGroupAddUnit(lv_samuroPlayer, lv_controlGroup, lv_samuroCargoUnit);
UnitControlGroupAddUnit(lv_samuroPlayer, 4, lv_samuroCargoUnit);
mods/heromods/samuro.stormmod — base.stormdata/LibHSAM.galaxy:654
UnitControlGroupAddUnit(lv_samuroPlayer, lv_controlGroup, lv_samuroCargoUnit);
UnitControlGroupAddUnit(lv_samuroPlayer, 4, lv_samuroCargoUnit);
UnitControlGroupRemoveUnit(lv_samuroPlayer, 4, lv_fakeSelectionVehicle);
UnitRemove(lv_fakeSelectionVehicle);
UnitSelect(lv_samuroCargoUnit, lv_samuroPlayer, true);