# Target Position For Order

Grammar — Target position for o
FlagsNative | Function

Returns the position of the target for an order, regardless of what type of target it is.

# Arguments

  • order — Order

Returns — point

native point OrderGetTargetPosition(order inOrder);

Category: Order / Order Properties

# Examples

campaigns/swarmstory.sc2campaignbase.sc2data/TriggerLibs/SwarmCampaignLib.galaxy:17229

    }

    if ((OrderGetTargetPosition(UnitOrder(EventUnitCreatedUnit(), 0)) != UnitRallyPointTargetPoint(lv_nearbyTownHall, 2, 1))) {
        return true;
    }

mods/heroesdata.stormmodbase.stormdata/TriggerLibs/GameDataHelperLib.galaxy:3152

        else {
            lv_autoAquired = true;
            if ((UnitOrderCount(lv_rexxar) != 0) && (OrderGetAbilityCommand(UnitOrder(lv_rexxar, 0)) != AbilityCommand("RexxarSpiritSwoop", 0)) && (OrderGetAbilityCommand(UnitOrder(lv_rexxar, 0)) != AbilityCommand("RexxarUnleashTheBoars", 0)) && (UnitGetType(OrderGetTargetItem(UnitOrder(lv_rexxar, 0))) != "RexxarFlare") && (OrderGetTargetPosition(UnitOrder(lv_rexxar, 0)) != Point(0.0, 0.0)) && (DistanceBetweenPoints(UnitGetPosition(lv_misha), UnitGetPosition(lv_rexxar)) <= 3.0) && ((OrderGetAbilityCommand(UnitOrder(lv_rexxar, 0)) != AbilityCommand("attack", 0)) || (UnitIsValid(OrderGetTargetUnit(UnitOrder(lv_rexxar, 0))) == false))) {
                UnitAbilityEnable(lv_misha, "attack", true);
                libGDHL_gf_HeroRexxarOrderMishaMoveNearPoint(lv_rexxar, lv_misha, OrderGetTargetPosition(UnitOrder(lv_rexxar, 0)));

mods/heroesdata.stormmodbase.stormdata/TriggerLibs/GameDataHelperLib.galaxy:3154

            if ((UnitOrderCount(lv_rexxar) != 0) && (OrderGetAbilityCommand(UnitOrder(lv_rexxar, 0)) != AbilityCommand("RexxarSpiritSwoop", 0)) && (OrderGetAbilityCommand(UnitOrder(lv_rexxar, 0)) != AbilityCommand("RexxarUnleashTheBoars", 0)) && (UnitGetType(OrderGetTargetItem(UnitOrder(lv_rexxar, 0))) != "RexxarFlare") && (OrderGetTargetPosition(UnitOrder(lv_rexxar, 0)) != Point(0.0, 0.0)) && (DistanceBetweenPoints(UnitGetPosition(lv_misha), UnitGetPosition(lv_rexxar)) <= 3.0) && ((OrderGetAbilityCommand(UnitOrder(lv_rexxar, 0)) != AbilityCommand("attack", 0)) || (UnitIsValid(OrderGetTargetUnit(UnitOrder(lv_rexxar, 0))) == false))) {
                UnitAbilityEnable(lv_misha, "attack", true);
                libGDHL_gf_HeroRexxarOrderMishaMoveNearPoint(lv_rexxar, lv_misha, OrderGetTargetPosition(UnitOrder(lv_rexxar, 0)));
                if ((OrderGetAbilityCommand(UnitOrder(lv_misha, 0)) != AbilityCommand("move", 0)) && (DistanceBetweenPoints(OrderGetTargetPosition(UnitOrder(lv_rexxar, 0)), UnitGetPosition(lv_misha)) < 4.0)) {
                    libNtve_gf_MakeUnitFacePoint(lv_misha, OrderGetTargetPosition(UnitOrder(lv_rexxar, 0)), 0.2);

mods/heroesdata.stormmodbase.stormdata/TriggerLibs/GameDataHelperLib.galaxy:3155

                UnitAbilityEnable(lv_misha, "attack", true);
                libGDHL_gf_HeroRexxarOrderMishaMoveNearPoint(lv_rexxar, lv_misha, OrderGetTargetPosition(UnitOrder(lv_rexxar, 0)));
                if ((OrderGetAbilityCommand(UnitOrder(lv_misha, 0)) != AbilityCommand("move", 0)) && (DistanceBetweenPoints(OrderGetTargetPosition(UnitOrder(lv_rexxar, 0)), UnitGetPosition(lv_misha)) < 4.0)) {
                    libNtve_gf_MakeUnitFacePoint(lv_misha, OrderGetTargetPosition(UnitOrder(lv_rexxar, 0)), 0.2);
                }

mods/heroesdata.stormmodbase.stormdata/TriggerLibs/GameDataHelperLib.galaxy:3156

                libGDHL_gf_HeroRexxarOrderMishaMoveNearPoint(lv_rexxar, lv_misha, OrderGetTargetPosition(UnitOrder(lv_rexxar, 0)));
                if ((OrderGetAbilityCommand(UnitOrder(lv_misha, 0)) != AbilityCommand("move", 0)) && (DistanceBetweenPoints(OrderGetTargetPosition(UnitOrder(lv_rexxar, 0)), UnitGetPosition(lv_misha)) < 4.0)) {
                    libNtve_gf_MakeUnitFacePoint(lv_misha, OrderGetTargetPosition(UnitOrder(lv_rexxar, 0)), 0.2);
                }

mods/heroesdata.stormmodbase.stormdata/TriggerLibs/GameDataHelperLib.galaxy:3162

            else {
                if ((UnitTechTreeBehaviorCount(lv_rexxar, "ShrubStatusController", c_techCountQueuedOrBetter) <= 0)) {
                    if ((DistanceBetweenPoints(UnitGetPosition(lv_misha), UnitGetPosition(lv_rexxar)) > 3.0) && ((OrderGetAbilityCommand(UnitOrder(lv_misha, 0)) == AbilityCommand("attack", 0)) || (UnitOrderCount(lv_misha) == 0) || (DistanceBetweenPoints(OrderGetTargetPosition(UnitOrder(lv_misha, 0)), UnitGetPosition(lv_rexxar)) > 6.0))) {
                        UnitIssueOrder(lv_misha, OrderTargetingPoint(AbilityCommand("move", 0), PointWithOffsetPolar(UnitGetPosition(lv_rexxar), 3.0, libNtve_gf_RandomAngle())), c_orderQueueReplace);
                        UnitAbilityEnable(lv_misha, "attack", false);

mods/heroesdata.stormmodbase.stormdata/TriggerLibs/GameDataHelperLib.galaxy:3205

        if ((UnitOrderCount(lv_rexxar) != 0) && (UnitBehaviorEnabled(lv_misha, "RexxarMishaHold") == false) && (libGDHL_gv_heroRexxarMishaLastKnownTargetLocation[lv_player] == null)) {
            if ((OrderGetAbilityCommand(UnitOrder(lv_rexxar, 0)) == AbilityCommand("attack", 0))) {
                if ((UnitOrderIsAcquired(lv_rexxar, 0) == true) && (OrderGetTargetPosition(UnitOrder(lv_rexxar, 1)) == UnitGetPosition(lv_rexxar))) {
                    lv_autoAquired = true;
                }

mods/heroesdata.stormmodbase.stormdata/TriggerLibs/GameDataHelperLib.galaxy:3229

                if ((OrderGetAbilityCommand(UnitOrder(lv_rexxar, 0)) == AbilityCommand("move", 0)) && (UnitHasBehavior2(lv_misha, "RexxarMishaManualOrder") == false)) {
                    UnitCreateEffectUnit(lv_rexxar, "RexxarMishaCommandRemoveTargetPriorityBuffSearch", lv_rexxar);
                    if ((DistanceBetweenPoints(OrderGetTargetPosition(UnitOrder(lv_rexxar, 0)), UnitGetPosition(lv_misha)) > 4.0) && (UnitBehaviorEnabled(lv_misha, "RexxarMishaHold") == false)) {
                        libGDHL_gf_HeroRexxarOrderMishaMoveNearPoint(lv_rexxar, lv_misha, OrderGetTargetPosition(UnitOrder(lv_rexxar, 0)));
                        lv_currentState = libGDHL_ge_MishaState_Moving;

mods/heroesdata.stormmodbase.stormdata/TriggerLibs/GameDataHelperLib.galaxy:3230

                    UnitCreateEffectUnit(lv_rexxar, "RexxarMishaCommandRemoveTargetPriorityBuffSearch", lv_rexxar);
                    if ((DistanceBetweenPoints(OrderGetTargetPosition(UnitOrder(lv_rexxar, 0)), UnitGetPosition(lv_misha)) > 4.0) && (UnitBehaviorEnabled(lv_misha, "RexxarMishaHold") == false)) {
                        libGDHL_gf_HeroRexxarOrderMishaMoveNearPoint(lv_rexxar, lv_misha, OrderGetTargetPosition(UnitOrder(lv_rexxar, 0)));
                        lv_currentState = libGDHL_ge_MishaState_Moving;
                    }

mods/heroesdata.stormmodbase.stormdata/TriggerLibs/GameDataHelperLib.galaxy:3248

                if ((OrderGetAbilityCommand(UnitOrder(lv_rexxar, 0)) == AbilityCommand("move", 0))) {
                    lv_currentState = libGDHL_ge_MishaState_Moving;
                    UnitIssueOrder(lv_misha, OrderTargetingPoint(AbilityCommand("move", 0), PointWithOffsetPolar(OrderGetTargetPosition(UnitOrder(lv_rexxar, 0)), 3.0, libNtve_gf_RandomAngle())), c_orderQueueReplace);
                }
                else {

mods/heroesdata.stormmodbase.stormdata/TriggerLibs/GameDataHelperLib.galaxy:3287

        else {
            if (((UnitOrderCount(lv_rexxar) == 0) || (OrderGetAbilityCommand(UnitOrder(lv_rexxar, 0)) == AbilityCommand("move", 2)))) {
                if (((DistanceBetweenPoints(UnitGetPosition(lv_misha), UnitGetPosition(lv_rexxar)) <= 4.0) || (DistanceBetweenPoints(OrderGetTargetPosition(UnitOrder(lv_misha, 0)), UnitGetPosition(lv_rexxar)) > 5.0))) {
                    UnitIssueOrder(lv_misha, Order(AbilityCommand("stop", 0)), c_orderQueueReplace);
                    lv_currentState = libGDHL_ge_MishaState_Idle;

mods/starcoop/starcoop.sc2modbase.sc2data/LibCOMI.galaxy:27836

    UnitBehaviorRemove(lv_summoned, "ZeratulTopBarWarpingIn", 1);
    UnitGroupClear(lv_group);
    libCOMI_gv_cM_ZeratulTopBarRallyPoint[EventPlayer()] = OrderGetTargetPosition(EventUnitOrder());
    return true;
}

mods/starcoop/starcoop.sc2modbase.sc2data/LibCOMI.galaxy:27858

    // Variable Initialization
    lv_group = libCOMI_gv_cM_ZeratulTopBarRallyRedirectUnits[EventPlayer()];
    lv_point = OrderGetTargetPosition(EventUnitOrder());

    // Actions

mods/starcoop/starcoop.sc2modbase.sc2data/LibCOMU.galaxy:1719

    }

    lv_orderLocation = OrderGetTargetPosition(lp_order);
    if (((VisIsVisibleForPlayer(1, lv_orderLocation) == true) || (lv_orderLocation == null))) {
    }

mods/starcoop/starcoop.sc2modbase.sc2data/LibCOMU.galaxy:1737

    // Implementation
    lv_microPlayer = UnitGetOwner(lp_orderedUnit);
    if (((libCOMU_gv_cT_MutatorEnabledQuickList[(libCOMU_ge_CT_MutatorQuickList_CT_QuickInsubordination)] == false) || (PlayerGroupHasPlayer(libCOOC_gf_HumanPlayers(), lv_microPlayer) == false) || (OrderGetFlag(lp_order, 8) == false) || (OrderGetTargetPosition(lp_order) == null) || (OrderGetTargetType(lp_order) == c_orderTargetNone) || (OrderGetTargetType(lp_order) == c_orderTargetNone))) {
        return ;
    }

mods/starcoop/starcoop.sc2modbase.sc2data/LibCOMU.galaxy:1741

    }

    lv_orderLocation = OrderGetTargetPosition(lp_order);
    if ((RandomInt(0, 10) > libCOMI_gf_MinimumDifficultyValueCoopInteger(8, 6, 4, 2, 0, 0))) {
        UnitIssueOrder(lp_orderedUnit, OrderTargetingPoint(OrderGetAbilityCommand(lp_order), PointWithOffsetPolar(lv_orderLocation, RandomFixed(1.0, 15.0), RandomFixed(0.0, 360.0))), c_orderQueueReplace);