# Order Targeting Unit

GrammarabilCmd targeting u
FlagsNative | Function

Returns an order targeting a unit. This is primarily for use in “Issue Order” and “Issue Order To Unit Group” actions.

# Arguments

  • abilcmd — Ability Command
  • unit — Unit

Returns — order

native order OrderTargetingUnit(
	abilcmd inAbilCmd,
	unit inUnit,
);

Category: Order / Orders To Be Issued

# Examples

# campaigns/liberty.sc2campaign

MapScript.galaxy

// L1742
OrderTargetingUnit(AbilityCommand("SS_BattlecruiserHunterSeekerAttack", 0), gv_viking)
// L2304
OrderTargetingUnit(AbilityCommand("attack", 0), lv_beamTarget)
// L2308
OrderTargetingUnit(AbilityCommand("SS_TerraTronBeamAttack", 0), lv_beamTarget)
// L2331
OrderTargetingUnit(AbilityCommand("attack", 0), lv_beamTarget)
// L2335
OrderTargetingUnit(AbilityCommand("SS_TerraTronBeamAttack", 0), lv_beamTarget)
// L4827
OrderTargetingUnit(AbilityCommand("SS_CarrierBossAttackTarget", 0), gv_viking)
// L329
OrderTargetingUnit(null, gv_tHEONETRUCK)
// L1210
OrderTargetingUnit(AbilityCommand("attack", 0), libNtve_gf_ClosestUnitToPoint(UnitGetPosition(auto182727CD_var), UnitGroup("Marine", gv_p4_COLONISTS, RegionEntireMap(), UnitFilter(0, 0, 0, (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32))), 0)))
// L1331
OrderTargetingUnit(AbilityCommand("attack", 0), UnitLastCreated())
// L1333
OrderTargetingUnit(AbilityCommand("attack", 0), UnitLastCreated())
// L1515
OrderTargetingUnit(null, UnitFromId(236))
// L1525
OrderTargetingUnit(AbilityCommand("SCVHarvest", 0), libNtve_gf_ClosestUnitToPoint(UnitGetPosition(auto338F5CC8_var), UnitGroup("MineralField", 0, RegionCircle(UnitGetPosition(auto338F5CC8_var), 12.0), UnitFilter(0, 0, 0, (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32))), 0)))
// L2533
OrderTargetingUnit(null, gv_activeCivilianShip)
// L3684
OrderTargetingUnit(null, gv_activeCivilianShip)
// L3752
OrderTargetingUnit(null, gv_activeCivilianShip)
// L6035
OrderTargetingUnit(null, gv_briefingBunker)
// L2807
OrderTargetingUnit(AbilityCommand("attack", 0), UnitFromId(17))
// L2818
OrderTargetingUnit(AbilityCommand("attack", 0), UnitFromId(17))
// L2829
OrderTargetingUnit(AbilityCommand("attack", 0), UnitFromId(17))
// L2335
OrderTargetingUnit(null, UnitFromId(1678))
// L2343
OrderTargetingUnit(null, UnitFromId(1678))
// L2399
OrderTargetingUnit(null, UnitFromId(2722))
// L2407
OrderTargetingUnit(null, UnitFromId(2722))
// L2463
OrderTargetingUnit(null, UnitFromId(1594))
// L2471
OrderTargetingUnit(null, UnitFromId(1594))
// L2964
OrderTargetingUnit(null, lv_colonistShip)
// L2970
OrderTargetingUnit(null, lv_colonistShip)
// L3043
OrderTargetingUnit(null, lv_colonistShip)
// L3049
OrderTargetingUnit(null, lv_colonistShip)
// L2291
OrderTargetingUnit(AbilityCommand("attack", 0), lv_victim)
// L2453
OrderTargetingUnit(null, UnitGroupRandomUnit(UnitGroup("InfestableHut", gv_p05_COLONIST, gv_infestationRegion[lv_colonyIndex], UnitFilter(0, 0, (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32))), 0), c_unitCountAlive))
// L4066
OrderTargetingUnit(AbilityCommand("attack", 0), UnitGroupRandomUnit(UnitGroup("InfestableHut", c_playerAny, RegionFromId(52), UnitFilter(0, 0, (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32))), 0), c_unitCountAlive))
// L4285
OrderTargetingUnit(AbilityCommand("attack", 0), UnitFromId(210))
// L4338
OrderTargetingUnit(AbilityCommand("attack", 0), UnitFromId(90))
// L4547
OrderTargetingUnit(AbilityCommand("attack", 0), UnitFromId(210))
// L4567
OrderTargetingUnit(AbilityCommand("attack", 0), UnitFromId(92))
// L5889
OrderTargetingUnit(AbilityCommand("move", 0), UnitFromId(90))
// L5891
OrderTargetingUnit(AbilityCommand("move", 0), UnitFromId(90))
// L5893
OrderTargetingUnit(AbilityCommand("move", 0), UnitFromId(90))
// L1436
OrderTargetingUnit(AbilityCommand("attack", 0), UnitFromId(2))
// L1439
OrderTargetingUnit(AbilityCommand("attack", 0), UnitFromId(2))
// L3133
OrderTargetingUnit(AbilityCommand("Yamato", 0), UnitFromId(2))
// L3134
OrderTargetingUnit(AbilityCommand("attack", 0), UnitFromId(2))
// L3136
OrderTargetingUnit(AbilityCommand("attack", 0), UnitFromId(2))
// L3139
OrderTargetingUnit(AbilityCommand("Yamato", 0), UnitFromId(2))
// L3140
OrderTargetingUnit(AbilityCommand("attack", 0), UnitFromId(2))
// L5544
OrderTargetingUnit(AbilityCommand("attack", 0), UnitFromId(341))
// L1366
OrderTargetingUnit(null, UnitGroupRandomUnit(UnitGroup("Hut", gv_p06_CIVILIANS, RegionCircle(UnitGetPosition(EventUnit()), 50.0), UnitFilter(0, 0, (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32))), 0), c_unitCountAlive))
// L2466
OrderTargetingUnit(AbilityCommand("attack", 0), gv_odin)
// L2477
OrderTargetingUnit(null, UnitGroupRandomUnit(UnitGroup("Hut", c_playerAny, RegionCircle(UnitGetPosition(EventUnit()), 50.0), UnitFilter(0, 0, (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32))), 0), c_unitCountAlive))
// L2529
OrderTargetingUnit(AbilityCommand("attack", 0), gv_odin)
// L2546
OrderTargetingUnit(AbilityCommand("attack", 0), gv_odin)
// L2817
OrderTargetingUnit(AbilityCommand("MedivacTransport", 0), lv_thor)
// L6129
OrderTargetingUnit(AbilityCommand("Rally", 0), UnitFromId(10))
// L6282
OrderTargetingUnit(AbilityCommand("250mmStrikeCannons", 0), EventUnitTarget())
// L9824
OrderTargetingUnit(AbilityCommand("attack", 0), UnitFromId(627))
// L9888
OrderTargetingUnit(AbilityCommand("attack", 0), UnitFromId(627))
// L10072
OrderTargetingUnit(AbilityCommand("ConsumeDNA", 0), UnitGroupRandomUnit(lv_zergGroup, c_unitCountAlive))
// L10123
OrderTargetingUnit(AbilityCommand("ConsumeDNA", 0), UnitGroupRandomUnit(lv_protossGroup, c_unitCountAlive))
// L10198
OrderTargetingUnit(AbilityCommand("attack", 0), UnitFromId(492))
// L12738
OrderTargetingUnit(AbilityCommand("attack", 0), gv_hercules)
// L12846
OrderTargetingUnit(AbilityCommand("attack", 0), gv_hercules)
// L836
OrderTargetingUnit(AbilityCommand("move", 4), gv_raynor)
// L880
OrderTargetingUnit(AbilityCommand("move", 4), gv_raynor)
// L2657
OrderTargetingUnit(AbilityCommand("attack", 0), gv_holoboards[6])
// L2874
OrderTargetingUnit(AbilityCommand("attack", 0), UnitFromId(105))
// L4786
OrderTargetingUnit(AbilityCommand("move", 0), gv_introVik02)
// L4787
OrderTargetingUnit(AbilityCommand("move", 0), gv_introVik02)
// L4788
OrderTargetingUnit(AbilityCommand("move", 0), gv_introVik02)
// L4789
OrderTargetingUnit(AbilityCommand("move", 0), gv_introVik02)
// L4790
OrderTargetingUnit(AbilityCommand("move", 0), gv_introVik02)
// L4797
OrderTargetingUnit(AbilityCommand("move", 4), gv_introCiv02)
// L2822
OrderTargetingUnit(AbilityCommand("attack", 0), libNtve_gf_ClosestUnitToPoint(UnitGetPosition(auto07E01211_var), UnitGroup(null, gv_pLAYER_01_USER, RegionFromId(25), UnitFilter(0, 0, 0, (1 << (c_targetFilterDead - 32))), 0)))
// L4686
OrderTargetingUnit(AbilityCommand("SCVHarvest", 0), libNtve_gf_ClosestUnitToPoint(UnitGetPosition(auto6AA43B43_var), UnitGroup("MineralField", 0, RegionEntireMap(), UnitFilter(0, 0, (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32))), 0)))
// L1485
OrderTargetingUnit(AbilityCommand("move", 0), UnitFromId(1167))
// L2526
OrderTargetingUnit(AbilityCommand("attack", 0), UnitFromId(366))
// L2530
OrderTargetingUnit(AbilityCommand("attack", 0), UnitFromId(855))
// L4807
OrderTargetingUnit(null, UnitFromId(13))
// L4809
OrderTargetingUnit(null, UnitFromId(13))
// L4811
OrderTargetingUnit(null, UnitFromId(13))
// L4813
OrderTargetingUnit(null, UnitFromId(13))
// L5439
OrderTargetingUnit(AbilityCommand("attack", 0), gv_victoryHyperion)
// L5450
OrderTargetingUnit(AbilityCommand("attack", 0), gv_victoryHyperion)
// L5460
OrderTargetingUnit(AbilityCommand("attack", 0), gv_victoryHyperion)
// L4840
OrderTargetingUnit(AbilityCommand("SCVHarvest", 0), UnitFromId(125))
// L4841
OrderTargetingUnit(AbilityCommand("SCVHarvest", 0), UnitFromId(174))
// L4842
OrderTargetingUnit(AbilityCommand("SCVHarvest", 0), UnitFromId(162))
// L4843
OrderTargetingUnit(AbilityCommand("SCVHarvest", 0), UnitFromId(830))
// L4844
OrderTargetingUnit(AbilityCommand("SCVHarvest", 0), UnitFromId(39))
// L5252
OrderTargetingUnit(null, gv_victoryDropship)
// L323
OrderTargetingUnit(AbilityCommand("ProbeHarvest", 0), gf_NodeMatchingCustomValue(lv_targetTerrazineIndex))
// L2680
OrderTargetingUnit(AbilityCommand("ProbeHarvest", 0), UnitGroupRandomUnit(UnitGroup("MineralField", c_playerAny, RegionFromId(36), UnitFilter(0, 0, (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32))), 0), c_unitCountAlive))
// L2684
OrderTargetingUnit(AbilityCommand("ProbeHarvest", 0), UnitGroupRandomUnit(UnitGroup("MineralField", c_playerAny, RegionFromId(38), UnitFilter(0, 0, (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32))), 0), c_unitCountAlive))
// L2696
OrderTargetingUnit(AbilityCommand("ProbeHarvest", 0), lv_newTerrazineTarget)
// L2811
OrderTargetingUnit(AbilityCommand("ProbeHarvest", 0), UnitFromId(39))
// L4059
OrderTargetingUnit(AbilityCommand("ProbeHarvest", 0), UnitFromId(39))
// L470
OrderTargetingUnit(AbilityCommand("Snipe", 0), UnitGroupUnit(lp_candidates, 1))
// L481
OrderTargetingUnit(AbilityCommand("heal", 0), gv_tosh)
// L1994
OrderTargetingUnit(AbilityCommand("Obliterate", 0), EventUnit())
// L2113
OrderTargetingUnit(AbilityCommand("Obliterate", 0), lv_target)