# Triggering Range Unit

Grammar — Triggering range unit
FlagsNative | 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

Category: Unit / Basic

# Examples

campaigns/swarm.sc2campaignbase.sc2maps/maps/campaign/swarm/zchar02.sc2map/MapScript.galaxy:4382

        }

        if (!((UnitIsAlive(EventUnitRangeUnit()) == true))) {
            return false;
        }

campaigns/swarm.sc2campaignbase.sc2maps/maps/campaign/swarm/zchar02.sc2map/MapScript.galaxy:4392

    }

    if ((UnitGetCustomValue(EventUnitRangeUnit(), 0) == 0.0)) {
        UnitSetCustomValue(EventUnitRangeUnit(), 0, 1.0);
        UnitKill(EventUnitRangeUnit());

campaigns/swarm.sc2campaignbase.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.sc2campaignbase.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.sc2campaignbase.sc2maps/maps/campaign/swarm/zexpedition01.sc2map/MapScript.galaxy:2172

        }

        if (!((UnitGroupHasUnit(gv_roachRescues, EventUnitRangeUnit()) == true))) {
            return false;
        }

campaigns/swarm.sc2campaignbase.sc2maps/maps/campaign/swarm/zexpedition01.sc2map/MapScript.galaxy:2182

    }

    UnitGroupRemove(gv_roachRescues, EventUnitRangeUnit());
    gf_RescueUnit(EventUnitRangeUnit(), EventUnit());
    return true;

campaigns/swarm.sc2campaignbase.sc2maps/maps/campaign/swarm/zexpedition01.sc2map/MapScript.galaxy:2183


    UnitGroupRemove(gv_roachRescues, EventUnitRangeUnit());
    gf_RescueUnit(EventUnitRangeUnit(), EventUnit());
    return true;
}

campaigns/swarm.sc2campaignbase.sc2maps/maps/campaign/swarm/zspace01.sc2map/MapScript.galaxy:1976

    }

    UnitIssueOrder(EventUnitRangeUnit(), OrderTargetingUnit(AbilityCommand("attack", 0), gv_hyperion), c_orderQueueReplace);
    return true;
}

campaigns/swarm.sc2campaignbase.sc2maps/maps/campaign/swarm/zspace02.sc2map/MapScript.galaxy:1582

        }

        if (!((UnitIsAlive(EventUnitRangeUnit()) == true))) {
            return false;
        }

campaigns/swarm.sc2campaignbase.sc2maps/maps/campaign/swarm/zspace02.sc2map/MapScript.galaxy:1602

    }

    UnitKill(EventUnitRangeUnit());
    TriggerExecute(gt_ObjectiveFindSecretDocumentsUpdate, true, false);
    return true;

campaigns/swarm.sc2campaignbase.sc2maps/maps/campaign/swarm/zspace02.sc2map/MapScript.galaxy:3908

        }

        if (!((UnitIsAlive(EventUnitRangeUnit()) == true))) {
            return false;
        }

campaigns/swarm.sc2campaignbase.sc2maps/maps/campaign/swarm/zspace02.sc2map/MapScript.galaxy:3918

    }

    autoAB2BECF6_val = EventUnitRangeUnit();
    if (autoAB2BECF6_val == gv__1PrisonCellBeacons[1]) {
        lv_index = 1;

campaigns/swarm.sc2campaignbase.sc2maps/maps/campaign/swarm/zzerus01.sc2map/MapScript.galaxy:3460

        }

        if (!((libNtve_gf_UnitIsVisibleToPlayer(EventUnitRangeUnit(), gv_pLAYER_01_USER) == true))) {
            return false;
        }

campaigns/swarm.sc2campaignbase.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.sc2campaignbase.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.sc2campaignbase.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.sc2campaignbase.sc2maps/maps/campaign/swarm/zzerus01.sc2map/MapScript.galaxy:3661

        }

        if (!((UnitIsAlive(EventUnitRangeUnit()) == true))) {
            return false;
        }

campaigns/swarm.sc2campaignbase.sc2maps/maps/campaign/swarm/zzerus01.sc2map/MapScript.galaxy:3676


    TriggerEnable(TriggerGetCurrent(), false);
    gv_poolEssenceBeingPinged = EventUnitRangeUnit();
    TriggerExecute(gt_EssencePoolIntroQ, true, false);
    return true;

campaigns/swarm.sc2campaignbase.sc2maps/maps/campaign/swarm/zzerus01.sc2map/MapScript.galaxy:3788

        }

        if (!((UnitIsAlive(EventUnitRangeUnit()) == true))) {
            return false;
        }

campaigns/swarm.sc2campaignbase.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.sc2mapMapScript.galaxy:4382

        }

        if (!((UnitIsAlive(EventUnitRangeUnit()) == true))) {
            return false;
        }

campaigns/swarm.sc2campaign/base.sc2maps/maps/campaign/swarm/zchar02.sc2mapMapScript.galaxy:4392

    }

    if ((UnitGetCustomValue(EventUnitRangeUnit(), 0) == 0.0)) {
        UnitSetCustomValue(EventUnitRangeUnit(), 0, 1.0);
        UnitKill(EventUnitRangeUnit());

campaigns/swarm.sc2campaign/base.sc2maps/maps/campaign/swarm/zchar02.sc2mapMapScript.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.sc2mapMapScript.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.sc2mapMapScript.galaxy:2172

        }

        if (!((UnitGroupHasUnit(gv_roachRescues, EventUnitRangeUnit()) == true))) {
            return false;
        }

campaigns/swarm.sc2campaign/base.sc2maps/maps/campaign/swarm/zexpedition01.sc2mapMapScript.galaxy:2182

    }

    UnitGroupRemove(gv_roachRescues, EventUnitRangeUnit());
    gf_RescueUnit(EventUnitRangeUnit(), EventUnit());
    return true;

campaigns/swarm.sc2campaign/base.sc2maps/maps/campaign/swarm/zexpedition01.sc2mapMapScript.galaxy:2183


    UnitGroupRemove(gv_roachRescues, EventUnitRangeUnit());
    gf_RescueUnit(EventUnitRangeUnit(), EventUnit());
    return true;
}

campaigns/swarm.sc2campaign/base.sc2maps/maps/campaign/swarm/zspace01.sc2mapMapScript.galaxy:1976

    }

    UnitIssueOrder(EventUnitRangeUnit(), OrderTargetingUnit(AbilityCommand("attack", 0), gv_hyperion), c_orderQueueReplace);
    return true;
}

campaigns/swarm.sc2campaign/base.sc2maps/maps/campaign/swarm/zspace02.sc2mapMapScript.galaxy:1582

        }

        if (!((UnitIsAlive(EventUnitRangeUnit()) == true))) {
            return false;
        }

campaigns/swarm.sc2campaign/base.sc2maps/maps/campaign/swarm/zspace02.sc2mapMapScript.galaxy:1602

    }

    UnitKill(EventUnitRangeUnit());
    TriggerExecute(gt_ObjectiveFindSecretDocumentsUpdate, true, false);
    return true;

campaigns/swarm.sc2campaign/base.sc2maps/maps/campaign/swarm/zspace02.sc2mapMapScript.galaxy:3908

        }

        if (!((UnitIsAlive(EventUnitRangeUnit()) == true))) {
            return false;
        }

campaigns/swarm.sc2campaign/base.sc2maps/maps/campaign/swarm/zspace02.sc2mapMapScript.galaxy:3918

    }

    autoAB2BECF6_val = EventUnitRangeUnit();
    if (autoAB2BECF6_val == gv__1PrisonCellBeacons[1]) {
        lv_index = 1;

campaigns/swarm.sc2campaign/base.sc2maps/maps/campaign/swarm/zzerus01.sc2mapMapScript.galaxy:3460

        }

        if (!((libNtve_gf_UnitIsVisibleToPlayer(EventUnitRangeUnit(), gv_pLAYER_01_USER) == true))) {
            return false;
        }

campaigns/swarm.sc2campaign/base.sc2maps/maps/campaign/swarm/zzerus01.sc2mapMapScript.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.sc2mapMapScript.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.sc2mapMapScript.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.sc2mapMapScript.galaxy:3661

        }

        if (!((UnitIsAlive(EventUnitRangeUnit()) == true))) {
            return false;
        }

campaigns/swarm.sc2campaign/base.sc2maps/maps/campaign/swarm/zzerus01.sc2mapMapScript.galaxy:3676


    TriggerEnable(TriggerGetCurrent(), false);
    gv_poolEssenceBeingPinged = EventUnitRangeUnit();
    TriggerExecute(gt_EssencePoolIntroQ, true, false);
    return true;

campaigns/swarm.sc2campaign/base.sc2maps/maps/campaign/swarm/zzerus01.sc2mapMapScript.galaxy:3788

        }

        if (!((UnitIsAlive(EventUnitRangeUnit()) == true))) {
            return false;
        }

campaigns/swarm.sc2campaign/base.sc2maps/maps/campaign/swarm/zzerus01.sc2mapMapScript.galaxy:3800

    auto01442886_var = 1;
    for ( ; auto01442886_var <= auto01442886_ae; auto01442886_var += 1 ) {
        if ((gv_poolEssence[auto01442886_var] == EventUnitRangeUnit())) {
            lv_index = auto01442886_var;
            break;