# Remove Unit From All Waves And Set Home
Grammar — Remove unit from all waves and set home to home|Point.
Flags —Native
|Action
Removes a unit from any waves it is in and sets its home point.
# Arguments
unit
— Unitpoint
— Home
Returns — void
native void AIRemoveUnitFromAnyWavesAndSetHome(
unit u,
point home,
);
# Related
Category: AI / MiscCampaign / Actions
- Pause AI Time —
void
— AITimePause - Start Campaign AI For All Players —
void
— CampaignInitAI - Start Campaign AI For Player —
void
— AICampaignStart - Global Suicide —
void
— AIGlobalSuicide - Enable/Disable Script Control For Unit —
void
— AISetUnitScriptControlled - Enable/Disable Script Control For Unit Group —
void
— AISetGroupScriptControlled - Enable/Disable Wave Use For Unit —
void
— AISetUnitNotUsableInWaves - Enable/Disable Wave Use For Unit Group —
void
— AISetGroupNotUsableInWaves - Enable/Disable Suicide For Unit —
void
— AISetUnitSuicide - Enable/Disable Suicide For Unit Group —
void
— AISetGroupSuicide - Remove Unit From All Waves —
void
— AIRemoveUnitFromAnyWaves - Remove Unit Group From All Waves —
void
— AIRemoveGroupFromAnyWaves - Remove Unit From All Waves And Set Home —
void
— AIRemoveUnitFromAnyWavesAndSetHome - Remove Unit Group From All Waves And Set Home —
void
— AIRemoveGroupFromAnyWavesAndSetHome - Init Campaign Towns —
void
— AIInitCampaignTowns - Init Campaign Harvesting —
void
— AIInitCampaignHarvest - Issue AI Order —
void
— libNtve_gf_AICast
# Examples
campaigns/liberty.sc2campaign — base.sc2maps/maps/campaign/thanson01.sc2map/MapScript.galaxy:3940
autoDC7CDD91_var = UnitGroupUnitFromEnd(autoDC7CDD91_g, autoDC7CDD91_u);
if (autoDC7CDD91_var == null) { break; }
AIRemoveUnitFromAnyWavesAndSetHome(autoDC7CDD91_var, PointFromId(281));
}
auto23B6BB2B_g = UnitGroup(null, gv_p3_ZERG_LIGHTBLUE_SE, RegionEntireMap(), UnitFilter(0, 0, (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32))), 0);
campaigns/liberty.sc2campaign — base.sc2maps/maps/campaign/thanson01.sc2map/MapScript.galaxy:3947
auto23B6BB2B_var = UnitGroupUnitFromEnd(auto23B6BB2B_g, auto23B6BB2B_u);
if (auto23B6BB2B_var == null) { break; }
AIRemoveUnitFromAnyWavesAndSetHome(auto23B6BB2B_var, PointFromId(283));
}
autoFBC7DD9D_g = UnitGroup("NydusCanal", c_playerAny, RegionEntireMap(), UnitFilter(0, 0, (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32))), 0);
campaigns/liberty.sc2campaign/base.sc2maps/maps/campaign/thanson01.sc2map — MapScript.galaxy:3940
autoDC7CDD91_var = UnitGroupUnitFromEnd(autoDC7CDD91_g, autoDC7CDD91_u);
if (autoDC7CDD91_var == null) { break; }
AIRemoveUnitFromAnyWavesAndSetHome(autoDC7CDD91_var, PointFromId(281));
}
auto23B6BB2B_g = UnitGroup(null, gv_p3_ZERG_LIGHTBLUE_SE, RegionEntireMap(), UnitFilter(0, 0, (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32))), 0);
campaigns/liberty.sc2campaign/base.sc2maps/maps/campaign/thanson01.sc2map — MapScript.galaxy:3947
auto23B6BB2B_var = UnitGroupUnitFromEnd(auto23B6BB2B_g, auto23B6BB2B_u);
if (auto23B6BB2B_var == null) { break; }
AIRemoveUnitFromAnyWavesAndSetHome(auto23B6BB2B_var, PointFromId(283));
}
autoFBC7DD9D_g = UnitGroup("NydusCanal", c_playerAny, RegionEntireMap(), UnitFilter(0, 0, (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32))), 0);
campaigns/swarm.sc2campaign — base.sc2maps/maps/campaign/swarm/zchar01.sc2map/MapScript.galaxy:2633
AIAttackWaveCancel(AIUnitGetWave(gv_zagara));
AISetUnitScriptControlled(gv_zagara, false);
AIRemoveUnitFromAnyWavesAndSetHome(gv_zagara, PointFromId(3));
AIAttackWaveSetTargetPatrol(gv_pLAYER_02_ZERG, 0);
AIAttackWaveSetGatherPoint(gv_pLAYER_02_ZERG, UnitGetPosition(gv_zagara));
campaigns/swarm.sc2campaign — base.sc2maps/maps/campaign/swarm/zlab02.sc2map/MapScript.galaxy:8316
}
AIRemoveUnitFromAnyWavesAndSetHome(EventUnit(), PointFromId(652));
return true;
}
campaigns/swarm.sc2campaign/base.sc2maps/maps/campaign/swarm/zchar01.sc2map — MapScript.galaxy:2633
AIAttackWaveCancel(AIUnitGetWave(gv_zagara));
AISetUnitScriptControlled(gv_zagara, false);
AIRemoveUnitFromAnyWavesAndSetHome(gv_zagara, PointFromId(3));
AIAttackWaveSetTargetPatrol(gv_pLAYER_02_ZERG, 0);
AIAttackWaveSetGatherPoint(gv_pLAYER_02_ZERG, UnitGetPosition(gv_zagara));
campaigns/swarm.sc2campaign/base.sc2maps/maps/campaign/swarm/zlab02.sc2map — MapScript.galaxy:8316
}
AIRemoveUnitFromAnyWavesAndSetHome(EventUnit(), PointFromId(652));
return true;
}
campaigns/void.sc2campaign — base.sc2maps/maps/campaign/void/pulnar01.sc2map/MapScript.galaxy:474
if (auto2439952A_var == null) { break; }
if ((AIUnitGetWave(auto2439952A_var) == null) && (RegionContainsPoint(gv_celestialLocks[lp_index].lv_defenseRegion, UnitGetGoalPosition(auto2439952A_var)) == true)) {
AIRemoveUnitFromAnyWavesAndSetHome(auto2439952A_var, PlayerStartLocation(UnitGetOwner(auto2439952A_var)));
UnitIssueOrder(auto2439952A_var, OrderTargetingPoint(null, PlayerStartLocation(UnitGetOwner(auto2439952A_var))), c_orderQueueReplace);
AISetUnitScriptControlled(auto2439952A_var, false);
campaigns/void.sc2campaign/base.sc2maps/maps/campaign/void/pulnar01.sc2map — MapScript.galaxy:474
if (auto2439952A_var == null) { break; }
if ((AIUnitGetWave(auto2439952A_var) == null) && (RegionContainsPoint(gv_celestialLocks[lp_index].lv_defenseRegion, UnitGetGoalPosition(auto2439952A_var)) == true)) {
AIRemoveUnitFromAnyWavesAndSetHome(auto2439952A_var, PlayerStartLocation(UnitGetOwner(auto2439952A_var)));
UnitIssueOrder(auto2439952A_var, OrderTargetingPoint(null, PlayerStartLocation(UnitGetOwner(auto2439952A_var))), c_orderQueueReplace);
AISetUnitScriptControlled(auto2439952A_var, false);