# Set Targeting Order

Grammar — Set Targeting Order for playerGroup and unitGroup to order and sticky make sticky.
FlagsNative | Action

Setting the unit group to a unit group other than “null” will enter targeting mode for the specified unit group even if they are not selected. This unit group must remain referenced until targeting is completed. Setting the order to “No Order” will end targeting mode. Setting the order as “sticky” will keep it active until canceled or another order is set.

# Arguments

  • playergroup — PlayerGroup
  • unitgroup — Unit Group
  • order — Order
  • bool<preset::Do_Do_Not_Option> — Sticky

Returns — void

native void UISetTargetingOrder(
	playergroup inPlayers,
	unitgroup inUnits,
	order inOrder,
	bool inSticky,
);

Category: UI / Game UI

# Examples

campaigns/voidstory.sc2campaignbase.sc2data/TriggerLibs/VoidCampaignMissionLib.galaxy:479

    libVCUI_gf_PU_TargetingSetCharges(libVCMI_gv_pM_SoATargetingChargesTotal, libVCMI_gv_pM_SoATargetingChargesTotal);
    if ((libVCMI_gv_pM_SoATargetingOrder != null)) {
        UISetTargetingOrder(PlayerGroupSingle(1), libVCUI_gv_pU_GPCasterGroup, libVCMI_gv_pM_SoATargetingOrder, false);
    }

campaigns/voidstory.sc2campaignbase.sc2data/TriggerLibs/VoidCampaignMissionLib.galaxy:4577

        TriggerSendEvent(libVCMI_gv_pMC_SoATargetingEventExited);
    }
    UISetTargetingOrder(PlayerGroupSingle(1), libVCUI_gv_pU_GPCasterGroup, null, false);
    libVCMI_gv_pM_SoATargetingChargesSpent = 0;
    TriggerEnable(libVCMI_gt_PM_SoATargetingCancel, false);

campaigns/voidstory.sc2campaignbase.sc2data/TriggerLibs/VoidCampaignMissionLib.galaxy:4639

        else {
            Wait(0.1, c_timeGame);
            UISetTargetingOrder(PlayerGroupSingle(1), libVCMI_gv_pM_SoACasterGroup, libVCMI_gv_pM_SoATargetingOrder, false);
        }
    }

campaigns/voidstory.sc2campaignbase.sc2data/TriggerLibs/VoidCampaignMissionLib.galaxy:4655

        TriggerEnable(TriggerGetCurrent(), false);
        Wait(0.1, c_timeGame);
        UISetTargetingOrder(PlayerGroupSingle(1), libVCMI_gv_pM_SoATargetingDirectionGroup, OrderTargetingPoint(libVCMI_gv_pM_SoATargetingExecuteCommand, UnitGetPosition(libVCMI_gv_pM_SoATargetingUnit[libVCMI_gv_pM_SoATargetingChargesSpent])), false);
        TriggerEnable(libVCMI_gt_PM_SoATargetingDirectionChosen, true);
    }

campaigns/voidstory.sc2campaignbase.sc2data/TriggerLibs/VoidCampaignMissionLib.galaxy:4704

        libVCUI_gf_PU_TargetingSetInstructionText(libVoiC_gf_PC_PerkTargetingText(libVCMI_gv_pM_SoATargetingAbilityInstance, 1));
        Wait(0.1, c_timeGame);
        UISetTargetingOrder(PlayerGroupSingle(1), libVCMI_gv_pM_SoACasterGroup, libVCMI_gv_pM_SoATargetingOrder, false);
        TriggerEnable(libVCMI_gt_PM_SoATargetingPointChosen, true);
        TriggerEnable(TriggerGetCurrent(), false);

campaigns/voidstory.sc2campaignbase.sc2data/TriggerLibs/VoidCampaignMissionLib.galaxy:4765

        libVCMI_gv_pM_SoATargetingChargesSpent = 0;
        libVCUI_gf_PU_TargetingSetInstructionText(libVoiC_gf_PC_PerkTargetingText(libVCMI_gv_pM_SoATargetingAbilityInstance, 1));
        UISetTargetingOrder(PlayerGroupSingle(1), libVCMI_gv_pM_SoACasterGroup, libVCMI_gv_pM_SoATargetingOrder, false);
        libVCMI_gf_PM_SoATargetingCleanupActorsAndUnits();
        libVCUI_gf_PU_TargetingSetCharges(libVCMI_gv_pM_SoATargetingChargesTotal, libVCMI_gv_pM_SoATargetingChargesTotal);

campaigns/voidstory.sc2campaignbase.sc2data/TriggerLibs/VoidCampaignMissionLib.galaxy:4796

    libVoiC_gf_PC_StatRecordTargetingModeAbort();
    UnitIssueOrder(libVCMI_gv_sOA_CasterUnit, Order(AbilityCommand("stop", 0)), c_orderQueueReplace);
    UISetTargetingOrder(PlayerGroupSingle(1), libVCUI_gv_pU_GPCasterGroup, null, false);
    libVCMI_gf_PM_SoATargetingCleanupActorsAndUnits();
    if (((libVCMI_gv_pM_SoATargetingChargesSpent == 0) || (libVCMI_gf_PM_SoATargetingPauseEnabled() == true))) {

mods/heroesdata.stormmodbase.stormdata/TriggerLibs/GameLib.galaxy:16935


    lv_killingPlayer = libNtve_gf_KillingPlayer();
    UISetTargetingOrder(libCore_gv_playerGroupFromPlayer[lv_deadPlayer], libNtve_gf_ConvertUnitToUnitGroup(lv_deadUnit), null, false);
    libGame_gv_players[lv_deadPlayer].lv_isDead = true;
    libNtve_gf_CreateUnitsWithDefaultFacing(1, "DeadUnitCameraTarget", 0, lv_deadPlayer, UnitGetPosition(lv_deadUnit), lv_deadUnit);

mods/heromods/ana.stormmodbase.stormdata/LibHANA.galaxy:497

    }

    UISetTargetingOrder(PlayerGroupSingle(lv_player), null, OrderTargetingPoint(AbilityCommand("AnaEyeOfHorusAttack", 0), Point(PointGetX(EventPlayerEffectUsedPoint(c_effectLocationTargetPoint)), PointGetY(EventPlayerEffectUsedPoint(c_effectLocationTargetPoint)))), true);
    return true;
}

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

        TriggerEnable(libCOMI_gt_CM_SoATargetingPointChosen, true);
        TriggerEnable(libCOMI_gt_CM_SoATargetingDirectionChosen, true);
        UISetTargetingOrder(PlayerGroupSingle(lp_player), libCOMI_gv_cM_SoACasterGroup[lp_player], libCOMI_gv_cM_SoATargetingOrder[lp_player], false);
        libCOMI_gv_cM_SoATargetingPhase[lp_player] = libCOMI_ge_CM_SoATargetingPhaseType_Location;
    }

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

    lv_casterPlayer = UnitGetOwner(EventUnit());
    if ((UnitAbilityChargeInfo(EventUnit(), AbilityCommand("SpawnToxicNest", 0), c_unitAbilChargeCountLeft) > 0.0)) {
        UISetTargetingOrder(PlayerGroupSingle(lv_casterPlayer), libCOMI_gv_cM_GlobalCasterUnitGroup[lv_casterPlayer], OrderTargetingPoint(AbilityCommand("SpawnToxicNest", 0), UnitGetPosition(libCOMI_gv_cM_GlobalCasterUnit[lv_casterPlayer])), false);
    }

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

    }
    if ((UnitAbilityChargeInfo(libCOMI_gv_cM_GlobalCasterUnit[EventPlayerEffectUsedUnitOwner(c_effectPlayerOrigin)], AbilityCommand("HHBomberPlatformAreaBombTopBarOrder", 0), c_unitAbilChargeCountLeft) > 0.0)) {
        UISetTargetingOrder(PlayerGroupSingle(EventPlayerEffectUsedUnitOwner(c_effectPlayerOrigin)), libCOMI_gv_cM_GlobalCasterUnitGroup[EventPlayerEffectUsedUnitOwner(c_effectPlayerOrigin)], OrderTargetingPoint(AbilityCommand("HHBomberPlatformAreaBombTopBarOrder", 0), UnitGetPosition(libCOMI_gv_cM_GlobalCasterUnit[EventPlayerEffectUsedUnitOwner(c_effectPlayerOrigin)])), false);
    }

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

    lv_casterPlayer = UnitGetOwner(EventUnit());
    if ((UnitAbilityChargeInfo(EventUnit(), AbilityCommand("HHTrainTopBar", 0), c_unitAbilChargeCountLeft) > 0.0)) {
        UISetTargetingOrder(PlayerGroupSingle(lv_casterPlayer), libCOMI_gv_cM_GlobalCasterUnitGroup[lv_casterPlayer], OrderTargetingPoint(AbilityCommand("HHTrainTopBar", 0), UnitGetPosition(libCOMI_gv_cM_GlobalCasterUnit[lv_casterPlayer])), false);
    }

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

    }

    UISetTargetingOrder(PlayerGroupSingle(UnitGetOwner(libCOMI_gv_cM_LaserDrillUnit[lv_player])), libCOMI_gv_cM_LaserDrillUnitGroup[lv_player], OrderTargetingPoint(AbilityCommand("DrakkenLaserDrillBFG", 0), UnitGetPosition(libCOMI_gv_cM_LaserDrillUnit[lv_player])), false);
    return true;
}

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

    }

    UISetTargetingOrder(PlayerGroupSingle(UnitGetOwner(libCOMI_gv_cM_LaserDrillUnit[lv_player])), libCOMI_gv_cM_LaserDrillUnitGroup[lv_player], OrderTargetingPoint(AbilityCommand("DrakkenLaserDrillNuke", 0), UnitGetPosition(libCOMI_gv_cM_LaserDrillUnit[lv_player])), false);
    return true;
}

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

    Wait(0.5, c_timeGame);
    UISetCursorVisible(lv_pg, true);
    UISetTargetingOrder(lv_pg, libCOMI_gv_cM_NovaGriffinTransportUnitGroup[lv_p], OrderTargetingPoint(AbilityCommand("NovaGriffinTransportUnloadUnits", 0), UnitGetPosition(libCOMI_gv_cM_NovaGriffinTransportUnit[lv_p])), false);
    return true;
}

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

    lv_casterPlayer = UnitGetOwner(EventUnit());
    if ((UnitAbilityChargeInfo(EventUnit(), AbilityCommand("DeployPowerTowerStetmann", 0), c_unitAbilChargeCountLeft) > 0.0)) {
        UISetTargetingOrder(PlayerGroupSingle(lv_casterPlayer), libCOMI_gv_cM_GlobalCasterUnitGroup[lv_casterPlayer], OrderTargetingPoint(AbilityCommand("DeployPowerTowerStetmann", 0), UnitGetPosition(libCOMI_gv_cM_GlobalCasterUnit[lv_casterPlayer])), false);
    }

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

    Wait(0.5, c_timeGame);
    UISetCursorVisible(lv_pg, true);
    UISetTargetingOrder(PlayerGroupSingle(UnitGetOwner(libCOMI_gv_cM_TychusMedicTransportUnit[lv_p])), libCOMI_gv_cM_TychusMedicTransportUnitGroup[lv_p], OrderTargetingPoint(AbilityCommand("TychusMedicTransportUnloadUnits", 0), UnitGetPosition(libCOMI_gv_cM_TychusMedicTransportUnit[lv_p])), false);
    return true;
}

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


    libNtve_gf_PlayerRemoveCooldown(lv_player, CatalogFieldValueGet(c_gameCatalogAbil, "ZeratulMapWideStasisIssueOrder", "Cost[" + IntToString(0) + "].Cooldown.Link", lv_player));
    UISetTargetingOrder(PlayerGroupSingle(UnitGetOwner(libCOMI_gv_cM_Zeratul_HeroStructure[lv_player])), libCOMI_gv_cM_Zeratul_HeroStructureUnitGroup[lv_player], OrderTargetingPoint(AbilityCommand("ZeratulMapWideStasis", 0), UnitGetPosition(libCOMI_gv_cM_Zeratul_HeroStructure[lv_player])), false);
    return true;
}