# Rescue Unit Group
Grammar — Rescue unit|Unit for player player and changeColor|Change/Retain Color
Flags —Action
Causes the units in a unit group to be rescued, changing ownership and changing or retaining color.
# Arguments
unitgroup
— Unitsint
— Playerbool
<preset::Unit_Color_Change_Option> — Change Color
Returns — void
void libNtve_gf_RescueUnit2(
unitgroup lp_unit,
int lp_player,
bool lp_changeColor,
);
# Related
Category: Unit / Basic
- Unit Show Kill Display —
void
— UnitShowKillDisplay - Unit Can Path To Point —
bool
— UnitPathableToPoint - Unit Can Path To Unit —
bool
— UnitPathableToUnit - Create Units With Default Facing —
void
— libNtve_gf_CreateUnitsWithDefaultFacing - Create Units With Point Facing —
void
— libNtve_gf_CreateUnitsAtPoint2 - Create Units Facing Angle —
unitgroup
— UnitCreate - Create Units Facing Point —
unitgroup
— libNtve_gf_UnitCreateFacingPoint - Last Created Unit —
unit
— UnitLastCreated - Last Created Units —
unitgroup
— UnitLastCreatedGroup - Original Caster Of Unit —
unit
— UnitGetOriginalCaster - Effect That Created Unit —
string
<gamelink::Effect> — UnitGetOriginalEffect - Replace Unit —
void
— libNtve_gf_ReplaceUnit - Last Replaced Unit —
unit
— libNtve_gf_LastReplacedUnit - Change Owner —
void
— UnitSetOwner - Unit Owner Changes —
void
— TriggerAddEventUnitChangeOwner - Old Unit Owner —
int
— EventUnitOwnerOld - New Unit Owner —
int
— EventUnitOwnerNew - Rescue Unit —
void
— libNtve_gf_RescueUnit - Rescue Unit Group —
void
— libNtve_gf_RescueUnit2 - Kill Unit —
void
— UnitKill - Revive Unit —
void
— UnitRevive - Remove Unit —
void
— UnitRemove - Owner Of Unit —
int
— UnitGetOwner - Unit Is Alive —
bool
— UnitIsAlive - Unit Is Valid —
bool
— UnitIsValid - Unit Group Is Dead —
bool
— libNtve_gf_UnitGroupIsDead - Move Unit Instantly —
void
— UnitSetPosition - Make Unit Face Angle —
void
— UnitSetFacing - Make Unit Face Point —
void
— libNtve_gf_MakeUnitFacePoint - Position Of Unit —
point
— UnitGetPosition - Goal Position Of Unit —
point
— UnitGetGoalPosition - Facing Angle Of Unit —
fixed
— UnitGetFacing - Pause/Unpause Unit —
void
— libNtve_gf_PauseUnit - Pause/Unpause All Units —
void
— UnitPauseAll - Sleep/WakeUp Unit —
void
— libNtve_gf_SleepUnit - Show/Hide Unit —
void
— libNtve_gf_ShowHideUnit - Share Vision of Unit —
void
— libNtve_gf_ShareVisionofUnit - Unit Is Paused —
bool
— libNtve_gf_UnitIsPaused - Unit Is Sleepiing —
bool
— libNtve_gf_UnitIsSleepiing - Unit Is Hidden —
bool
— libNtve_gf_UnitIsHidden - Unit Is Visible To Player —
bool
— libNtve_gf_UnitIsVisibleToPlayer - Set Unit Custom Value —
void
— UnitSetCustomValue - Custom Value Of Unit —
fixed
— UnitGetCustomValue - Unit Enters/Leaves Region —
void
— TriggerAddEventUnitRegion - Triggering Region —
region
— EventUnitRegion - Unit Enters/Leaves Point —
void
— TriggerAddEventUnitRangePoint - Unit Enters/Leaves Range Of Unit —
void
— TriggerAddEventUnitRange - Triggering Range Unit —
unit
— EventUnitRangeUnit - Unit In Region —
bool
— libNtve_gf_UnitInRegion - Triggering Unit —
unit
— EventUnit - Load Unit Model —
void
— UnitLoadModel - Unload Unit Model —
void
— UnitUnloadModel - Agent Of Player For Unit —
unit
— UnitAgent - Change Empty Unit Variables In Events —
void
— UnitEventSetNullVariableInvalid - Name of Unit —
text
— UnitGetName - Ideal Harvester Count —
int
— UnitIdealWorkerCount - Current Harvester Count —
int
— UnitCurrentWorkerCount
# Examples
campaigns/liberty.sc2campaign — base.sc2maps/maps/campaign/thanson02.sc2map/MapScript.galaxy:2615
UnitGroupAddUnitGroup(lv_introHellionGroup, UnitLastCreatedGroup());
libCamp_gf_CreateDropPod(libCamp_ge_DropPodRace_Terran, PointFromId(930), UnitLastCreatedGroup(), true);
libNtve_gf_RescueUnit2(lv_introHellionGroup, gv_pLAYER_01_USER, true);
SoundtrackPlay(PlayerGroupAll(), c_soundtrackCategoryMusic, "THanson02MusicSwann", c_soundtrackCueAny, c_soundtrackIndexAny, false);
Wait(3.0, c_timeGame);
campaigns/liberty.sc2campaign/base.sc2maps/maps/campaign/thanson02.sc2map — MapScript.galaxy:2615
UnitGroupAddUnitGroup(lv_introHellionGroup, UnitLastCreatedGroup());
libCamp_gf_CreateDropPod(libCamp_ge_DropPodRace_Terran, PointFromId(930), UnitLastCreatedGroup(), true);
libNtve_gf_RescueUnit2(lv_introHellionGroup, gv_pLAYER_01_USER, true);
SoundtrackPlay(PlayerGroupAll(), c_soundtrackCategoryMusic, "THanson02MusicSwann", c_soundtrackCueAny, c_soundtrackIndexAny, false);
Wait(3.0, c_timeGame);
campaigns/swarm.sc2campaign — base.sc2maps/maps/campaign/swarm/evolution/zevolutionbaneling.sc2map/MapScript.galaxy:472
UnitGroupIssueOrder(lv_group, Order(AbilityCommand("BurrowHunterUp", 0)), c_orderQueueReplace);
Wait(0.5, c_timeGame);
libNtve_gf_RescueUnit2(lv_group, gv_pLAYER_01_USER, true);
UnitGroupAddUnitGroup(gv_hunterPlayerUnitGroup, lv_group);
}
campaigns/swarm.sc2campaign — base.sc2maps/maps/campaign/swarm/evolution/zevolutionzergling.sc2map/MapScript.galaxy:3126
Wait(1.0, c_timeGame);
lv_larvaGroup1 = UnitGroup("Larva", gv_pLAYER_01_USER, RegionFromId(21), UnitFilter(0, 0, (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32))), 0);
libNtve_gf_RescueUnit2(lv_larvaGroup1, gv_pLAYER_01_USER, true);
Wait(0.5, c_timeGame);
lv_larvaGroup2 = UnitGroup("Larva", gv_pLAYER_01_USER, RegionFromId(21), UnitFilter(0, 0, (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32))), 0);
campaigns/swarm.sc2campaign — base.sc2maps/maps/campaign/swarm/evolution/zevolutionzergling.sc2map/MapScript.galaxy:3130
lv_larvaGroup2 = UnitGroup("Larva", gv_pLAYER_01_USER, RegionFromId(21), UnitFilter(0, 0, (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32))), 0);
UnitGroupRemoveUnitGroup(lv_larvaGroup2, lv_larvaGroup1);
libNtve_gf_RescueUnit2(lv_larvaGroup2, gv_pLAYER_01_USER, true);
gv_introSwarmlingLarvaAdded2 = true;
TransmissionWait(TransmissionLastSent(), 0.0);
campaigns/swarm.sc2campaign — base.sc2maps/maps/campaign/swarm/zlab01.sc2map/MapScript.galaxy:7854
}
libNtve_gf_ShowHideUnit(UnitFromId(975), true);
libNtve_gf_RescueUnit2(lv_rESCUE_GROUP, gv_pLAYER_01_USER, true);
}
else if (auto59A19B1C_val == UnitFromId(414)) {
campaigns/swarm.sc2campaign — base.sc2maps/maps/campaign/swarm/zlab01.sc2map/MapScript.galaxy:7868
}
libNtve_gf_ShowHideUnit(UnitFromId(978), true);
libNtve_gf_RescueUnit2(lv_rESCUE_GROUP, gv_pLAYER_01_USER, true);
}
else if (auto59A19B1C_val == UnitFromId(115)) {
campaigns/swarm.sc2campaign — base.sc2maps/maps/campaign/swarm/zlab01.sc2map/MapScript.galaxy:7882
}
libNtve_gf_ShowHideUnit(UnitFromId(976), true);
libNtve_gf_RescueUnit2(lv_rESCUE_GROUP, gv_pLAYER_01_USER, true);
}
else if (auto59A19B1C_val == UnitFromId(114)) {
campaigns/swarm.sc2campaign — base.sc2maps/maps/campaign/swarm/zlab01.sc2map/MapScript.galaxy:7896
}
libNtve_gf_ShowHideUnit(UnitFromId(977), true);
libNtve_gf_RescueUnit2(lv_rESCUE_GROUP, gv_pLAYER_01_USER, true);
}
else {
campaigns/swarm.sc2campaign/base.sc2maps/maps/campaign/swarm/evolution/zevolutionbaneling.sc2map — MapScript.galaxy:472
UnitGroupIssueOrder(lv_group, Order(AbilityCommand("BurrowHunterUp", 0)), c_orderQueueReplace);
Wait(0.5, c_timeGame);
libNtve_gf_RescueUnit2(lv_group, gv_pLAYER_01_USER, true);
UnitGroupAddUnitGroup(gv_hunterPlayerUnitGroup, lv_group);
}
campaigns/swarm.sc2campaign/base.sc2maps/maps/campaign/swarm/evolution/zevolutionzergling.sc2map — MapScript.galaxy:3126
Wait(1.0, c_timeGame);
lv_larvaGroup1 = UnitGroup("Larva", gv_pLAYER_01_USER, RegionFromId(21), UnitFilter(0, 0, (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32))), 0);
libNtve_gf_RescueUnit2(lv_larvaGroup1, gv_pLAYER_01_USER, true);
Wait(0.5, c_timeGame);
lv_larvaGroup2 = UnitGroup("Larva", gv_pLAYER_01_USER, RegionFromId(21), UnitFilter(0, 0, (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32))), 0);
campaigns/swarm.sc2campaign/base.sc2maps/maps/campaign/swarm/evolution/zevolutionzergling.sc2map — MapScript.galaxy:3130
lv_larvaGroup2 = UnitGroup("Larva", gv_pLAYER_01_USER, RegionFromId(21), UnitFilter(0, 0, (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32))), 0);
UnitGroupRemoveUnitGroup(lv_larvaGroup2, lv_larvaGroup1);
libNtve_gf_RescueUnit2(lv_larvaGroup2, gv_pLAYER_01_USER, true);
gv_introSwarmlingLarvaAdded2 = true;
TransmissionWait(TransmissionLastSent(), 0.0);
campaigns/swarm.sc2campaign/base.sc2maps/maps/campaign/swarm/zlab01.sc2map — MapScript.galaxy:7854
}
libNtve_gf_ShowHideUnit(UnitFromId(975), true);
libNtve_gf_RescueUnit2(lv_rESCUE_GROUP, gv_pLAYER_01_USER, true);
}
else if (auto59A19B1C_val == UnitFromId(414)) {
campaigns/swarm.sc2campaign/base.sc2maps/maps/campaign/swarm/zlab01.sc2map — MapScript.galaxy:7868
}
libNtve_gf_ShowHideUnit(UnitFromId(978), true);
libNtve_gf_RescueUnit2(lv_rESCUE_GROUP, gv_pLAYER_01_USER, true);
}
else if (auto59A19B1C_val == UnitFromId(115)) {
campaigns/swarm.sc2campaign/base.sc2maps/maps/campaign/swarm/zlab01.sc2map — MapScript.galaxy:7882
}
libNtve_gf_ShowHideUnit(UnitFromId(976), true);
libNtve_gf_RescueUnit2(lv_rESCUE_GROUP, gv_pLAYER_01_USER, true);
}
else if (auto59A19B1C_val == UnitFromId(114)) {
campaigns/swarm.sc2campaign/base.sc2maps/maps/campaign/swarm/zlab01.sc2map — MapScript.galaxy:7896
}
libNtve_gf_ShowHideUnit(UnitFromId(977), true);
libNtve_gf_RescueUnit2(lv_rESCUE_GROUP, gv_pLAYER_01_USER, true);
}
else {
campaigns/void.sc2campaign — base.sc2maps/maps/campaign/sc2tutorial.sc2map/MapScript.galaxy:16328
UISetFrameVisible(PlayerGroupAll(), c_syncFrameTypeResourcePanel, true);
UISetFrameVisible(PlayerGroupAll(), c_syncFrameTypeSupply, true);
libNtve_gf_RescueUnit2(gv_protossRescuedUnits, gv_p01_USER, true);
autoB23625D3_ae = UnitGroupCount(gv_protossProbes, c_unitCountAlive);
autoB23625D3_ai = 1;
campaigns/void.sc2campaign — base.sc2maps/maps/campaign/sc2tutorial.sc2map/MapScript.galaxy:19239
}
gv_protossStartingStalkers = UnitGroup("Stalker", 0, RegionEntireMap(), UnitFilter(0, 0, (1 << c_targetFilterMissile), (1 << (c_targetFilterUnderConstruction - 32)) | (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32))), 0);
libNtve_gf_RescueUnit2(gv_protossStartingStalkers, gv_p01_USER, true);
UnitIssueOrder(gv_protossWarpPrism, Order(AbilityCommand("TransportMode", 0)), c_orderQueueReplace);
Wait(0.5, c_timeGame);
campaigns/void.sc2campaign — base.sc2maps/maps/campaign/void/paiur04.sc2map/MapScript.galaxy:7320
}
UnitGroupAddUnitGroup(gv_activePlayerUnits, gv_purifierReinforcements);
libNtve_gf_RescueUnit2(gv_purifierReinforcements, gv_pLAYER_01_USER, true);
VisRevealerEnable(gv_hiveCluster1Revealer, false);
Wait(1.5, c_timeReal);
campaigns/void.sc2campaign — base.sc2maps/maps/campaign/void/paiur04.sc2map/MapScript.galaxy:7701
TriggerEnable(TriggerGetCurrent(), false);
UnitGroupAddUnitGroup(gv_activePlayerUnits, gv_darkTemplarReinforcements);
libNtve_gf_RescueUnit2(gv_darkTemplarReinforcements, gv_pLAYER_01_USER, true);
VisRevealerEnable(gv_hiveCluster2Revealer, false);
Wait(1.5, c_timeReal);
campaigns/void.sc2campaign/base.sc2maps/maps/campaign/sc2tutorial.sc2map — MapScript.galaxy:16328
UISetFrameVisible(PlayerGroupAll(), c_syncFrameTypeResourcePanel, true);
UISetFrameVisible(PlayerGroupAll(), c_syncFrameTypeSupply, true);
libNtve_gf_RescueUnit2(gv_protossRescuedUnits, gv_p01_USER, true);
autoB23625D3_ae = UnitGroupCount(gv_protossProbes, c_unitCountAlive);
autoB23625D3_ai = 1;
campaigns/void.sc2campaign/base.sc2maps/maps/campaign/sc2tutorial.sc2map — MapScript.galaxy:19239
}
gv_protossStartingStalkers = UnitGroup("Stalker", 0, RegionEntireMap(), UnitFilter(0, 0, (1 << c_targetFilterMissile), (1 << (c_targetFilterUnderConstruction - 32)) | (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32))), 0);
libNtve_gf_RescueUnit2(gv_protossStartingStalkers, gv_p01_USER, true);
UnitIssueOrder(gv_protossWarpPrism, Order(AbilityCommand("TransportMode", 0)), c_orderQueueReplace);
Wait(0.5, c_timeGame);
campaigns/void.sc2campaign/base.sc2maps/maps/campaign/void/paiur04.sc2map — MapScript.galaxy:7320
}
UnitGroupAddUnitGroup(gv_activePlayerUnits, gv_purifierReinforcements);
libNtve_gf_RescueUnit2(gv_purifierReinforcements, gv_pLAYER_01_USER, true);
VisRevealerEnable(gv_hiveCluster1Revealer, false);
Wait(1.5, c_timeReal);
campaigns/void.sc2campaign/base.sc2maps/maps/campaign/void/paiur04.sc2map — MapScript.galaxy:7701
TriggerEnable(TriggerGetCurrent(), false);
UnitGroupAddUnitGroup(gv_activePlayerUnits, gv_darkTemplarReinforcements);
libNtve_gf_RescueUnit2(gv_darkTemplarReinforcements, gv_pLAYER_01_USER, true);
VisRevealerEnable(gv_hiveCluster2Revealer, false);
Wait(1.5, c_timeReal);