# Set Targeting Order
Grammar — Set Targeting Order for playerGroup and unitGroup to order and sticky make sticky.
Flags —Native
|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
— PlayerGroupunitgroup
— Unit Grouporder
— Orderbool
<preset::Do_Do_Not_Option> — Sticky
Returns — void
native void UISetTargetingOrder(
playergroup inPlayers,
unitgroup inUnits,
order inOrder,
bool inSticky,
);
# Related
Category: UI / Game UI
- Set Screen Mode —
void
— UISetMode - Set Minimum Letterbox Height —
void
— UISetMinimumLetterboxHeight - Show/Hide Game UI —
void
— libNtve_gf_HideGameUI - Add/Remove UI Frame Type For Global Filter List —
void
— libNtve_gf_AddRemoveUIFrameTypeForGlobalFilterList - UI Frame Flag — preset —
int
- UI Frame Flag Check —
bool
— libNtve_gf_UIFrameFlagCheck - For Each UI Frame — macro
- Show/Hide UI Frame —
void
— UISetFrameVisible - Set BattleNet Button Offset —
void
— UISetBattleNetButtonOffset - Clear BattleNet Button Offset —
void
— UIClearBattleNetButtonOffset - UI Frame Is Visible —
bool
— UIFrameVisible - Show/Hide World —
void
— UISetWorldVisible - Show/Hide Achievement Panel —
void
— AchievementPanelSetVisible - Show/Hide Mouse Cursor —
void
— UISetCursorVisible - Enable/Disable Mouse Cursor Auto Hide —
void
— UISetCursorAutoHide - Enable/Disable Drag Selection —
void
— UISetDragSelectEnabled - Set Hot Key Profile —
void
— UISetHotkeyProfile - Lock Ally Color Setting —
void
— UIUnitColorStyleOverride - Unlock Ally Color Setting —
void
— UIUnitColorStyleClearOverride - Lock Flyer Helper Display —
void
— UIFlyerHelperOverride - Unlock Flyer Helper Display —
void
— UIFlyerHelperClearOverride - Lock Status Bar Display —
void
— UIStatusBarOverride - Unlock Status Bar Display —
void
— UIStatusBarClearOverride - Set Achievement Toast Style —
void
— UISetAchievementToastStyle - Set Minimap Background Color —
void
— UISetMiniMapBackGroundColor - Show/Hide Minimap Camera Field of View —
void
— UISetMiniMapCameraFoVVisible - Set Minimap Bounds —
void
— UISetMiniMapBounds - Enable/Disable Command Type —
void
— UISetCommandAllowed - Turn Ability Highlight On/Off —
void
— UISetButtonHighlighted - Turn Button Highlight On/Off —
void
— UISetButtonFaceHighlighted - Set Command Type Disabled Message —
void
— UISetCommandDisallowedMessage - Show/Hide Resource —
void
— UISetResourceVisible - Enable/Disable Selection Type —
void
— UISetSelectionTypeEnabled - Launch Nydus Link —
void
— UILaunchNydusLink - Show/Hide Message Log —
void
— UIMessageLogPanelSetVisible - Set Targeting Order —
void
— UISetTargetingOrder - Enable/Disable Hotkey —
void
— UISetHotkeyAllowed - Target Mode Updated —
void
— TriggerAddEventTargetModeUpdate - Resources Requested —
void
— TriggerAddEventResourceRequest - Resources Traded —
void
— TriggerAddEventResourceTrade - Target Mode Ability Command —
abilcmd
— EventTargetModeAbilCmd - Target Mode State —
int
<preset::TargetModeState> — EventTargetModeState - Resource Requested Amount —
int
— EventResourceRequestAmount - Resource Traded Amount —
int
— EventResourceTradeAmount - Resource Traded Recipient —
int
— EventResourceTradeRecipient
# Examples
campaigns/voidstory.sc2campaign — base.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.sc2campaign — base.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.sc2campaign — base.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.sc2campaign — base.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.sc2campaign — base.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.sc2campaign — base.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.sc2campaign — base.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.stormmod — base.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.stormmod — base.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.sc2mod — base.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.sc2mod — base.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.sc2mod — base.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.sc2mod — base.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.sc2mod — base.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.sc2mod — base.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.sc2mod — base.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.sc2mod — base.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.sc2mod — base.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.sc2mod — base.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;
}