# Triggering Range Unit
Grammar — Triggering range unit
Flags —Native
|Function
Returns the unit with which the triggering unit came in range. Used in response to Unit Enters/Leaves Range Of Unit.
Returns — unit
native unit EventUnitRangeUnit();
# Supported triggers
- Unit Enters/Leaves Range Of Unit — TriggerAddEventUnitRange
# 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/swarm.sc2campaign — base.sc2maps/maps/campaign/swarm/zchar02.sc2map/MapScript.galaxy:4382
}
if (!((UnitIsAlive(EventUnitRangeUnit()) == true))) {
return false;
}
campaigns/swarm.sc2campaign — base.sc2maps/maps/campaign/swarm/zchar02.sc2map/MapScript.galaxy:4392
}
if ((UnitGetCustomValue(EventUnitRangeUnit(), 0) == 0.0)) {
UnitSetCustomValue(EventUnitRangeUnit(), 0, 1.0);
UnitKill(EventUnitRangeUnit());
campaigns/swarm.sc2campaign — base.sc2maps/maps/campaign/swarm/zchar02.sc2map/MapScript.galaxy:4393
if ((UnitGetCustomValue(EventUnitRangeUnit(), 0) == 0.0)) {
UnitSetCustomValue(EventUnitRangeUnit(), 0, 1.0);
UnitKill(EventUnitRangeUnit());
gv_objectiveZergBiomassFound += 1;
campaigns/swarm.sc2campaign — base.sc2maps/maps/campaign/swarm/zchar02.sc2map/MapScript.galaxy:4394
if ((UnitGetCustomValue(EventUnitRangeUnit(), 0) == 0.0)) {
UnitSetCustomValue(EventUnitRangeUnit(), 0, 1.0);
UnitKill(EventUnitRangeUnit());
gv_objectiveZergBiomassFound += 1;
if ((gv_objectiveZergBiomassFound == gv_objectiveZergBiomassGoal)) {
campaigns/swarm.sc2campaign — base.sc2maps/maps/campaign/swarm/zexpedition01.sc2map/MapScript.galaxy:2172
}
if (!((UnitGroupHasUnit(gv_roachRescues, EventUnitRangeUnit()) == true))) {
return false;
}
campaigns/swarm.sc2campaign — base.sc2maps/maps/campaign/swarm/zexpedition01.sc2map/MapScript.galaxy:2182
}
UnitGroupRemove(gv_roachRescues, EventUnitRangeUnit());
gf_RescueUnit(EventUnitRangeUnit(), EventUnit());
return true;
campaigns/swarm.sc2campaign — base.sc2maps/maps/campaign/swarm/zexpedition01.sc2map/MapScript.galaxy:2183
UnitGroupRemove(gv_roachRescues, EventUnitRangeUnit());
gf_RescueUnit(EventUnitRangeUnit(), EventUnit());
return true;
}
campaigns/swarm.sc2campaign — base.sc2maps/maps/campaign/swarm/zspace01.sc2map/MapScript.galaxy:1976
}
UnitIssueOrder(EventUnitRangeUnit(), OrderTargetingUnit(AbilityCommand("attack", 0), gv_hyperion), c_orderQueueReplace);
return true;
}
campaigns/swarm.sc2campaign — base.sc2maps/maps/campaign/swarm/zspace02.sc2map/MapScript.galaxy:1582
}
if (!((UnitIsAlive(EventUnitRangeUnit()) == true))) {
return false;
}
campaigns/swarm.sc2campaign — base.sc2maps/maps/campaign/swarm/zspace02.sc2map/MapScript.galaxy:1602
}
UnitKill(EventUnitRangeUnit());
TriggerExecute(gt_ObjectiveFindSecretDocumentsUpdate, true, false);
return true;
campaigns/swarm.sc2campaign — base.sc2maps/maps/campaign/swarm/zspace02.sc2map/MapScript.galaxy:3908
}
if (!((UnitIsAlive(EventUnitRangeUnit()) == true))) {
return false;
}
campaigns/swarm.sc2campaign — base.sc2maps/maps/campaign/swarm/zspace02.sc2map/MapScript.galaxy:3918
}
autoAB2BECF6_val = EventUnitRangeUnit();
if (autoAB2BECF6_val == gv__1PrisonCellBeacons[1]) {
lv_index = 1;
campaigns/swarm.sc2campaign — base.sc2maps/maps/campaign/swarm/zzerus01.sc2map/MapScript.galaxy:3460
}
if (!((libNtve_gf_UnitIsVisibleToPlayer(EventUnitRangeUnit(), gv_pLAYER_01_USER) == true))) {
return false;
}
campaigns/swarm.sc2campaign — base.sc2maps/maps/campaign/swarm/zzerus01.sc2map/MapScript.galaxy:3464
}
if (!((UnitGroupCount(UnitGroup(null, gv_pLAYER_01_USER, RegionCircle(UnitGetPosition(EventUnitRangeUnit()), 10.0), UnitFilter(0, 0, (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32))), 1), c_unitCountAlive) > 0))) {
return false;
}
campaigns/swarm.sc2campaign — base.sc2maps/maps/campaign/swarm/zzerus01.sc2map/MapScript.galaxy:3475
TriggerEnable(TriggerGetCurrent(), false);
gf_PutReticleonPrimalHive(EventUnitRangeUnit());
TriggerQueueEnter();
if ((UnitGetPropertyFixed(EventUnitRangeUnit(), c_unitPropLifePercent, c_unitPropCurrent) > 80.0)) {
campaigns/swarm.sc2campaign — base.sc2maps/maps/campaign/swarm/zzerus01.sc2map/MapScript.galaxy:3477
gf_PutReticleonPrimalHive(EventUnitRangeUnit());
TriggerQueueEnter();
if ((UnitGetPropertyFixed(EventUnitRangeUnit(), c_unitPropLifePercent, c_unitPropCurrent) > 80.0)) {
libSwaC_gf_SetAllSoundChannelVolumesCampaign(libSwaC_ge_VolumeChannelModeCampaign_Speech);
libSwaC_gf_SendTransmissionCampaign(null, "zMission_Zerus01|Line00145", c_transmissionDurationAdd, 0.0, true, libSwaC_ge_CampaignTransmissionPortraitOptioins_HidePortraitAfter, libSwaC_ge_CampaignTransmissionCueSoundOptions_DefaultCueSoundBehavior);
campaigns/swarm.sc2campaign — base.sc2maps/maps/campaign/swarm/zzerus01.sc2map/MapScript.galaxy:3661
}
if (!((UnitIsAlive(EventUnitRangeUnit()) == true))) {
return false;
}
campaigns/swarm.sc2campaign — base.sc2maps/maps/campaign/swarm/zzerus01.sc2map/MapScript.galaxy:3676
TriggerEnable(TriggerGetCurrent(), false);
gv_poolEssenceBeingPinged = EventUnitRangeUnit();
TriggerExecute(gt_EssencePoolIntroQ, true, false);
return true;
campaigns/swarm.sc2campaign — base.sc2maps/maps/campaign/swarm/zzerus01.sc2map/MapScript.galaxy:3788
}
if (!((UnitIsAlive(EventUnitRangeUnit()) == true))) {
return false;
}
campaigns/swarm.sc2campaign — base.sc2maps/maps/campaign/swarm/zzerus01.sc2map/MapScript.galaxy:3800
auto01442886_var = 1;
for ( ; auto01442886_var <= auto01442886_ae; auto01442886_var += 1 ) {
if ((gv_poolEssence[auto01442886_var] == EventUnitRangeUnit())) {
lv_index = auto01442886_var;
break;
campaigns/swarm.sc2campaign/base.sc2maps/maps/campaign/swarm/zchar02.sc2map — MapScript.galaxy:4382
}
if (!((UnitIsAlive(EventUnitRangeUnit()) == true))) {
return false;
}
campaigns/swarm.sc2campaign/base.sc2maps/maps/campaign/swarm/zchar02.sc2map — MapScript.galaxy:4392
}
if ((UnitGetCustomValue(EventUnitRangeUnit(), 0) == 0.0)) {
UnitSetCustomValue(EventUnitRangeUnit(), 0, 1.0);
UnitKill(EventUnitRangeUnit());
campaigns/swarm.sc2campaign/base.sc2maps/maps/campaign/swarm/zchar02.sc2map — MapScript.galaxy:4393
if ((UnitGetCustomValue(EventUnitRangeUnit(), 0) == 0.0)) {
UnitSetCustomValue(EventUnitRangeUnit(), 0, 1.0);
UnitKill(EventUnitRangeUnit());
gv_objectiveZergBiomassFound += 1;
campaigns/swarm.sc2campaign/base.sc2maps/maps/campaign/swarm/zchar02.sc2map — MapScript.galaxy:4394
if ((UnitGetCustomValue(EventUnitRangeUnit(), 0) == 0.0)) {
UnitSetCustomValue(EventUnitRangeUnit(), 0, 1.0);
UnitKill(EventUnitRangeUnit());
gv_objectiveZergBiomassFound += 1;
if ((gv_objectiveZergBiomassFound == gv_objectiveZergBiomassGoal)) {
campaigns/swarm.sc2campaign/base.sc2maps/maps/campaign/swarm/zexpedition01.sc2map — MapScript.galaxy:2172
}
if (!((UnitGroupHasUnit(gv_roachRescues, EventUnitRangeUnit()) == true))) {
return false;
}
campaigns/swarm.sc2campaign/base.sc2maps/maps/campaign/swarm/zexpedition01.sc2map — MapScript.galaxy:2182
}
UnitGroupRemove(gv_roachRescues, EventUnitRangeUnit());
gf_RescueUnit(EventUnitRangeUnit(), EventUnit());
return true;
campaigns/swarm.sc2campaign/base.sc2maps/maps/campaign/swarm/zexpedition01.sc2map — MapScript.galaxy:2183
UnitGroupRemove(gv_roachRescues, EventUnitRangeUnit());
gf_RescueUnit(EventUnitRangeUnit(), EventUnit());
return true;
}
campaigns/swarm.sc2campaign/base.sc2maps/maps/campaign/swarm/zspace01.sc2map — MapScript.galaxy:1976
}
UnitIssueOrder(EventUnitRangeUnit(), OrderTargetingUnit(AbilityCommand("attack", 0), gv_hyperion), c_orderQueueReplace);
return true;
}
campaigns/swarm.sc2campaign/base.sc2maps/maps/campaign/swarm/zspace02.sc2map — MapScript.galaxy:1582
}
if (!((UnitIsAlive(EventUnitRangeUnit()) == true))) {
return false;
}
campaigns/swarm.sc2campaign/base.sc2maps/maps/campaign/swarm/zspace02.sc2map — MapScript.galaxy:1602
}
UnitKill(EventUnitRangeUnit());
TriggerExecute(gt_ObjectiveFindSecretDocumentsUpdate, true, false);
return true;
campaigns/swarm.sc2campaign/base.sc2maps/maps/campaign/swarm/zspace02.sc2map — MapScript.galaxy:3908
}
if (!((UnitIsAlive(EventUnitRangeUnit()) == true))) {
return false;
}
campaigns/swarm.sc2campaign/base.sc2maps/maps/campaign/swarm/zspace02.sc2map — MapScript.galaxy:3918
}
autoAB2BECF6_val = EventUnitRangeUnit();
if (autoAB2BECF6_val == gv__1PrisonCellBeacons[1]) {
lv_index = 1;
campaigns/swarm.sc2campaign/base.sc2maps/maps/campaign/swarm/zzerus01.sc2map — MapScript.galaxy:3460
}
if (!((libNtve_gf_UnitIsVisibleToPlayer(EventUnitRangeUnit(), gv_pLAYER_01_USER) == true))) {
return false;
}
campaigns/swarm.sc2campaign/base.sc2maps/maps/campaign/swarm/zzerus01.sc2map — MapScript.galaxy:3464
}
if (!((UnitGroupCount(UnitGroup(null, gv_pLAYER_01_USER, RegionCircle(UnitGetPosition(EventUnitRangeUnit()), 10.0), UnitFilter(0, 0, (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32))), 1), c_unitCountAlive) > 0))) {
return false;
}
campaigns/swarm.sc2campaign/base.sc2maps/maps/campaign/swarm/zzerus01.sc2map — MapScript.galaxy:3475
TriggerEnable(TriggerGetCurrent(), false);
gf_PutReticleonPrimalHive(EventUnitRangeUnit());
TriggerQueueEnter();
if ((UnitGetPropertyFixed(EventUnitRangeUnit(), c_unitPropLifePercent, c_unitPropCurrent) > 80.0)) {
campaigns/swarm.sc2campaign/base.sc2maps/maps/campaign/swarm/zzerus01.sc2map — MapScript.galaxy:3477
gf_PutReticleonPrimalHive(EventUnitRangeUnit());
TriggerQueueEnter();
if ((UnitGetPropertyFixed(EventUnitRangeUnit(), c_unitPropLifePercent, c_unitPropCurrent) > 80.0)) {
libSwaC_gf_SetAllSoundChannelVolumesCampaign(libSwaC_ge_VolumeChannelModeCampaign_Speech);
libSwaC_gf_SendTransmissionCampaign(null, "zMission_Zerus01|Line00145", c_transmissionDurationAdd, 0.0, true, libSwaC_ge_CampaignTransmissionPortraitOptioins_HidePortraitAfter, libSwaC_ge_CampaignTransmissionCueSoundOptions_DefaultCueSoundBehavior);
campaigns/swarm.sc2campaign/base.sc2maps/maps/campaign/swarm/zzerus01.sc2map — MapScript.galaxy:3661
}
if (!((UnitIsAlive(EventUnitRangeUnit()) == true))) {
return false;
}
campaigns/swarm.sc2campaign/base.sc2maps/maps/campaign/swarm/zzerus01.sc2map — MapScript.galaxy:3676
TriggerEnable(TriggerGetCurrent(), false);
gv_poolEssenceBeingPinged = EventUnitRangeUnit();
TriggerExecute(gt_EssencePoolIntroQ, true, false);
return true;
campaigns/swarm.sc2campaign/base.sc2maps/maps/campaign/swarm/zzerus01.sc2map — MapScript.galaxy:3788
}
if (!((UnitIsAlive(EventUnitRangeUnit()) == true))) {
return false;
}
campaigns/swarm.sc2campaign/base.sc2maps/maps/campaign/swarm/zzerus01.sc2map — MapScript.galaxy:3800
auto01442886_var = 1;
for ( ; auto01442886_var <= auto01442886_ae; auto01442886_var += 1 ) {
if ((gv_poolEssence[auto01442886_var] == EventUnitRangeUnit())) {
lv_index = auto01442886_var;
break;