# 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.sc2campaign

VoidCampaignMissionLib.galaxy

// L479
UISetTargetingOrder(PlayerGroupSingle(1), libVCUI_gv_pU_GPCasterGroup, libVCMI_gv_pM_SoATargetingOrder, false)
// L4577
UISetTargetingOrder(PlayerGroupSingle(1), libVCUI_gv_pU_GPCasterGroup, null, false)
// L4639
UISetTargetingOrder(PlayerGroupSingle(1), libVCMI_gv_pM_SoACasterGroup, libVCMI_gv_pM_SoATargetingOrder, false)
// L4655
UISetTargetingOrder(PlayerGroupSingle(1), libVCMI_gv_pM_SoATargetingDirectionGroup, OrderTargetingPoint(libVCMI_gv_pM_SoATargetingExecuteCommand, UnitGetPosition(libVCMI_gv_pM_SoATargetingUnit[libVCMI_gv_pM_SoATargetingChargesSpent])), false)
// L4704
UISetTargetingOrder(PlayerGroupSingle(1), libVCMI_gv_pM_SoACasterGroup, libVCMI_gv_pM_SoATargetingOrder, false)
// L4765
UISetTargetingOrder(PlayerGroupSingle(1), libVCMI_gv_pM_SoACasterGroup, libVCMI_gv_pM_SoATargetingOrder, false)
// L4796
UISetTargetingOrder(PlayerGroupSingle(1), libVCUI_gv_pU_GPCasterGroup, null, false)

# mods/heroesdata.stormmod

GameLib.galaxy

// L16935
UISetTargetingOrder(libCore_gv_playerGroupFromPlayer[lv_deadPlayer], libNtve_gf_ConvertUnitToUnitGroup(lv_deadUnit), null, false)

# mods/heromods/ana.stormmod

LibHANA.galaxy

// L497
UISetTargetingOrder(PlayerGroupSingle(lv_player), null, OrderTargetingPoint(AbilityCommand("AnaEyeOfHorusAttack", 0), Point(PointGetX(EventPlayerEffectUsedPoint(c_effectLocationTargetPoint)), PointGetY(EventPlayerEffectUsedPoint(c_effectLocationTargetPoint)))), true)

# mods/starcoop/starcoop.sc2mod

LibCOMI.galaxy

// L7027
UISetTargetingOrder(PlayerGroupSingle(lp_player), libCOMI_gv_cM_SoACasterGroup[lp_player], libCOMI_gv_cM_SoATargetingOrder[lp_player], false)
// L15706
UISetTargetingOrder(PlayerGroupSingle(lv_casterPlayer), libCOMI_gv_cM_GlobalCasterUnitGroup[lv_casterPlayer], OrderTargetingPoint(AbilityCommand("SpawnToxicNest", 0), UnitGetPosition(libCOMI_gv_cM_GlobalCasterUnit[lv_casterPlayer])), false)
// L20530
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)
// L20719
UISetTargetingOrder(PlayerGroupSingle(lv_casterPlayer), libCOMI_gv_cM_GlobalCasterUnitGroup[lv_casterPlayer], OrderTargetingPoint(AbilityCommand("HHTrainTopBar", 0), UnitGetPosition(libCOMI_gv_cM_GlobalCasterUnit[lv_casterPlayer])), false)
// L21145
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)
// L21172
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)
// L22962
UISetTargetingOrder(lv_pg, libCOMI_gv_cM_NovaGriffinTransportUnitGroup[lv_p], OrderTargetingPoint(AbilityCommand("NovaGriffinTransportUnloadUnits", 0), UnitGetPosition(libCOMI_gv_cM_NovaGriffinTransportUnit[lv_p])), false)
// L24041
UISetTargetingOrder(PlayerGroupSingle(lv_casterPlayer), libCOMI_gv_cM_GlobalCasterUnitGroup[lv_casterPlayer], OrderTargetingPoint(AbilityCommand("DeployPowerTowerStetmann", 0), UnitGetPosition(libCOMI_gv_cM_GlobalCasterUnit[lv_casterPlayer])), false)
// L25567
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)
// L27397
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)