# Target Type For Order
Grammar — Target type for o
Flags —Native
|Function
Returns the target type for the specified order.
# Arguments
order
— Order
Returns — int
<preset::OrderTargetType>
native int OrderGetTargetType(order inOrder);
# Related
Category: Order / Order Properties
- Player For Order —
int
— OrderGetPlayer - Ability Command For Order —
abilcmd
— OrderGetAbilityCommand - Flag Is Enabled For Order —
bool
— OrderGetFlag - Target Item For Order —
unit
— OrderGetTargetItem - Target Point For Order —
point
— OrderGetTargetPoint - Target Position For Order —
point
— OrderGetTargetPosition - Target Type For Order —
int
<preset::OrderTargetType> — OrderGetTargetType - Target Unit For Order —
unit
— OrderGetTargetUnit - Order Is Valid —
bool
— UnitOrderIsValid - Order Set Flag —
void
— OrderSetFlag
# Examples
campaigns/void.sc2campaign — base.sc2maps/maps/campaign/sc2tutorial.sc2map/MapScript.galaxy:2910
}
if (!((OrderGetTargetType(EventUnitOrder()) == c_orderTargetUnit))) {
return false;
}
campaigns/void.sc2campaign — base.sc2maps/maps/campaign/sc2tutorial.sc2map/MapScript.galaxy:2948
IntLoopBegin(0, 10);
for ( ; !IntLoopDone() ; IntLoopStep() ) {
if ((OrderGetAbilityCommand(UnitOrder(UnitGroupLoopCurrent(), IntLoopCurrent())) == AbilityCommand("attack", 0)) && (OrderGetTargetType(UnitOrder(UnitGroupLoopCurrent(), IntLoopCurrent())) == c_orderTargetUnit) && (UnitGetOwner(OrderGetTargetUnit(UnitOrder(UnitGroupLoopCurrent(), IntLoopCurrent()))) == gv_p01_USER)) {
UnitGroupAdd(gv_combatHelperUnitGroup, UnitGroupLoopCurrent());
ActorSend(libNtve_gf_MainActorofUnit(UnitGroupLoopCurrent()), "HaloStart");
campaigns/void.sc2campaign — base.sc2maps/maps/campaign/sc2tutorial.sc2map/MapScript.galaxy:3014
}
if (!(((OrderGetAbilityCommand(EventUnitOrder()) != AbilityCommand("attack", 0)) || ((OrderGetAbilityCommand(EventUnitOrder()) == AbilityCommand("attack", 0)) && (OrderGetTargetType(EventUnitOrder()) != c_orderTargetUnit)) || ((OrderGetAbilityCommand(EventUnitOrder()) == AbilityCommand("attack", 0)) && (OrderGetTargetType(EventUnitOrder()) == c_orderTargetUnit) && (UnitGetOwner(OrderGetTargetUnit(EventUnitOrder())) != gv_p01_USER))))) {
return false;
}
campaigns/void.sc2campaign — base.sc2maps/maps/campaign/sc2tutorial.sc2map/MapScript.galaxy:3014
}
if (!(((OrderGetAbilityCommand(EventUnitOrder()) != AbilityCommand("attack", 0)) || ((OrderGetAbilityCommand(EventUnitOrder()) == AbilityCommand("attack", 0)) && (OrderGetTargetType(EventUnitOrder()) != c_orderTargetUnit)) || ((OrderGetAbilityCommand(EventUnitOrder()) == AbilityCommand("attack", 0)) && (OrderGetTargetType(EventUnitOrder()) == c_orderTargetUnit) && (UnitGetOwner(OrderGetTargetUnit(EventUnitOrder())) != gv_p01_USER))))) {
return false;
}
campaigns/void.sc2campaign — base.sc2maps/maps/campaign/sc2tutorial.sc2map/MapScript.galaxy:3162
}
if (!(((OrderGetTargetType(EventUnitOrder()) == c_orderTargetPoint) || ((OrderGetTargetType(EventUnitOrder()) == c_orderTargetUnit) && (UnitGetOwner(OrderGetTargetUnit(EventUnitOrder())) != gv_p01_USER))))) {
return false;
}
campaigns/void.sc2campaign — base.sc2maps/maps/campaign/sc2tutorial.sc2map/MapScript.galaxy:3162
}
if (!(((OrderGetTargetType(EventUnitOrder()) == c_orderTargetPoint) || ((OrderGetTargetType(EventUnitOrder()) == c_orderTargetUnit) && (UnitGetOwner(OrderGetTargetUnit(EventUnitOrder())) != gv_p01_USER))))) {
return false;
}
campaigns/void.sc2campaign — base.sc2maps/maps/campaign/sc2tutorial.sc2map/MapScript.galaxy:3675
// Conditions
if (testConds) {
if (!((OrderGetTargetType(EventUnitOrder()) == c_orderTargetUnit))) {
return false;
}
campaigns/void.sc2campaign — base.sc2maps/maps/campaign/sc2tutorial.sc2map/MapScript.galaxy:4144
}
if ((OrderGetAbilityCommand(UnitOrder(gv_basic01Marine, 0)) == AbilityCommand("move", 0)) && (OrderGetTargetType(UnitOrder(gv_basic01Marine, 0)) == c_orderTargetPoint) && (DistanceBetweenPoints(PointFromId(6), OrderGetTargetPoint(UnitOrder(gv_basic01Marine, 0))) < 2.0)) {
gf_DestroyTutorialTextTag();
if ((TriggerActiveCount(gt_BasicMoveUnitIntroQ) == 0)) {
campaigns/void.sc2campaign — base.sc2maps/maps/campaign/sc2tutorial.sc2map/MapScript.galaxy:4411
gf_ResetReminderTimer();
gv_basic03LastOrderTime = GameGetMissionTime();
if ((OrderGetAbilityCommand(EventUnitOrder()) == AbilityCommand("attack", 0)) && (OrderGetTargetType(EventUnitOrder()) == c_orderTargetPoint) && (DistanceBetweenPoints(PointFromId(64), OrderGetTargetPoint(EventUnitOrder())) < 2.0)) {
gf_TutorialUnpause();
TransmissionClearAll();
campaigns/void.sc2campaign — base.sc2maps/maps/campaign/sc2tutorial.sc2map/MapScript.galaxy:4451
TriggerExecute(gt_BasicAttackCanceledOrderQ, true, false);
}
else if ((((OrderGetAbilityCommand(EventUnitOrder()) == AbilityCommand("attack", 0)) && (OrderGetTargetType(EventUnitOrder()) != c_orderTargetPoint)) || ((OrderGetAbilityCommand(EventUnitOrder()) == AbilityCommand("attack", 0)) && (OrderGetTargetType(EventUnitOrder()) == c_orderTargetPoint) && (DistanceBetweenPoints(PointFromId(64), OrderGetTargetPoint(EventUnitOrder())) >= 2.0)))) {
gf_SilenceQ();
TriggerExecute(gt_BasicAttackWrongTargetQ, true, false);
campaigns/void.sc2campaign/base.sc2maps/maps/campaign/sc2tutorial.sc2map — MapScript.galaxy:2910
}
if (!((OrderGetTargetType(EventUnitOrder()) == c_orderTargetUnit))) {
return false;
}
campaigns/void.sc2campaign/base.sc2maps/maps/campaign/sc2tutorial.sc2map — MapScript.galaxy:2948
IntLoopBegin(0, 10);
for ( ; !IntLoopDone() ; IntLoopStep() ) {
if ((OrderGetAbilityCommand(UnitOrder(UnitGroupLoopCurrent(), IntLoopCurrent())) == AbilityCommand("attack", 0)) && (OrderGetTargetType(UnitOrder(UnitGroupLoopCurrent(), IntLoopCurrent())) == c_orderTargetUnit) && (UnitGetOwner(OrderGetTargetUnit(UnitOrder(UnitGroupLoopCurrent(), IntLoopCurrent()))) == gv_p01_USER)) {
UnitGroupAdd(gv_combatHelperUnitGroup, UnitGroupLoopCurrent());
ActorSend(libNtve_gf_MainActorofUnit(UnitGroupLoopCurrent()), "HaloStart");
campaigns/void.sc2campaign/base.sc2maps/maps/campaign/sc2tutorial.sc2map — MapScript.galaxy:3014
}
if (!(((OrderGetAbilityCommand(EventUnitOrder()) != AbilityCommand("attack", 0)) || ((OrderGetAbilityCommand(EventUnitOrder()) == AbilityCommand("attack", 0)) && (OrderGetTargetType(EventUnitOrder()) != c_orderTargetUnit)) || ((OrderGetAbilityCommand(EventUnitOrder()) == AbilityCommand("attack", 0)) && (OrderGetTargetType(EventUnitOrder()) == c_orderTargetUnit) && (UnitGetOwner(OrderGetTargetUnit(EventUnitOrder())) != gv_p01_USER))))) {
return false;
}
campaigns/void.sc2campaign/base.sc2maps/maps/campaign/sc2tutorial.sc2map — MapScript.galaxy:3014
}
if (!(((OrderGetAbilityCommand(EventUnitOrder()) != AbilityCommand("attack", 0)) || ((OrderGetAbilityCommand(EventUnitOrder()) == AbilityCommand("attack", 0)) && (OrderGetTargetType(EventUnitOrder()) != c_orderTargetUnit)) || ((OrderGetAbilityCommand(EventUnitOrder()) == AbilityCommand("attack", 0)) && (OrderGetTargetType(EventUnitOrder()) == c_orderTargetUnit) && (UnitGetOwner(OrderGetTargetUnit(EventUnitOrder())) != gv_p01_USER))))) {
return false;
}
campaigns/void.sc2campaign/base.sc2maps/maps/campaign/sc2tutorial.sc2map — MapScript.galaxy:3162
}
if (!(((OrderGetTargetType(EventUnitOrder()) == c_orderTargetPoint) || ((OrderGetTargetType(EventUnitOrder()) == c_orderTargetUnit) && (UnitGetOwner(OrderGetTargetUnit(EventUnitOrder())) != gv_p01_USER))))) {
return false;
}
campaigns/void.sc2campaign/base.sc2maps/maps/campaign/sc2tutorial.sc2map — MapScript.galaxy:3162
}
if (!(((OrderGetTargetType(EventUnitOrder()) == c_orderTargetPoint) || ((OrderGetTargetType(EventUnitOrder()) == c_orderTargetUnit) && (UnitGetOwner(OrderGetTargetUnit(EventUnitOrder())) != gv_p01_USER))))) {
return false;
}
campaigns/void.sc2campaign/base.sc2maps/maps/campaign/sc2tutorial.sc2map — MapScript.galaxy:3675
// Conditions
if (testConds) {
if (!((OrderGetTargetType(EventUnitOrder()) == c_orderTargetUnit))) {
return false;
}
campaigns/void.sc2campaign/base.sc2maps/maps/campaign/sc2tutorial.sc2map — MapScript.galaxy:4144
}
if ((OrderGetAbilityCommand(UnitOrder(gv_basic01Marine, 0)) == AbilityCommand("move", 0)) && (OrderGetTargetType(UnitOrder(gv_basic01Marine, 0)) == c_orderTargetPoint) && (DistanceBetweenPoints(PointFromId(6), OrderGetTargetPoint(UnitOrder(gv_basic01Marine, 0))) < 2.0)) {
gf_DestroyTutorialTextTag();
if ((TriggerActiveCount(gt_BasicMoveUnitIntroQ) == 0)) {
campaigns/void.sc2campaign/base.sc2maps/maps/campaign/sc2tutorial.sc2map — MapScript.galaxy:4411
gf_ResetReminderTimer();
gv_basic03LastOrderTime = GameGetMissionTime();
if ((OrderGetAbilityCommand(EventUnitOrder()) == AbilityCommand("attack", 0)) && (OrderGetTargetType(EventUnitOrder()) == c_orderTargetPoint) && (DistanceBetweenPoints(PointFromId(64), OrderGetTargetPoint(EventUnitOrder())) < 2.0)) {
gf_TutorialUnpause();
TransmissionClearAll();
campaigns/void.sc2campaign/base.sc2maps/maps/campaign/sc2tutorial.sc2map — MapScript.galaxy:4451
TriggerExecute(gt_BasicAttackCanceledOrderQ, true, false);
}
else if ((((OrderGetAbilityCommand(EventUnitOrder()) == AbilityCommand("attack", 0)) && (OrderGetTargetType(EventUnitOrder()) != c_orderTargetPoint)) || ((OrderGetAbilityCommand(EventUnitOrder()) == AbilityCommand("attack", 0)) && (OrderGetTargetType(EventUnitOrder()) == c_orderTargetPoint) && (DistanceBetweenPoints(PointFromId(64), OrderGetTargetPoint(EventUnitOrder())) >= 2.0)))) {
gf_SilenceQ();
TriggerExecute(gt_BasicAttackWrongTargetQ, true, false);
mods/core.sc2mod — base.sc2data/TriggerLibs/Tactical/TactProtAI.galaxy:1068
curOrder = UnitOrder(aiUnit, 0);
if ((curOrder != null) && (OrderGetAbilityCommand(curOrder) == AbilityCommand(chrono, 0)) && (OrderGetTargetType(curOrder) == c_orderTargetUnit)) {
// should only happen in void with the new chrono boost
curTarget = OrderGetTargetUnit(curOrder);
mods/core.sc2mod — base.sc2data/TriggerLibs/Tactical/TactTerrAI.galaxy:1623
curOrder = UnitOrder(aiUnit, 0);
if ((curOrder != null) && (OrderGetAbilityCommand(curOrder) == AbilityCommand("attack", 0)) && (OrderGetTargetType(curOrder) == c_orderTargetUnit)) {
curTarget = OrderGetTargetUnit(curOrder);
}
mods/heroesdata.stormmod — base.stormdata/TriggerLibs/AILib.galaxy:432
lv_currentOrder = UnitOrder(lv_defenderUnit, 0);
lv_currentAbilityCommand = OrderGetAbilityCommand(lv_currentOrder);
if (((lv_currentOrder == null) || (lv_currentAbilityCommand != libAIAI_gv_aIMoveAbil) || (OrderGetTargetType(lv_currentOrder) != c_orderTargetPoint) || (OrderGetTargetPoint(lv_currentOrder) != libAIAI_gv_defenderAI[lp_defenderAIIndex].lv_leashPositions[lv_unitIndex]))) {
UnitIssueOrder(lv_defenderUnit, OrderTargetingPoint(libAIAI_gv_aIMoveAbil, libAIAI_gv_defenderAI[lp_defenderAIIndex].lv_leashPositions[lv_unitIndex]), c_orderQueueReplace);
UnitIssueOrder(lv_defenderUnit, OrderTargetingPoint(libAIAI_gv_aITurnAbil, PointWithOffsetPolar(libAIAI_gv_defenderAI[lp_defenderAIIndex].lv_leashPositions[lv_unitIndex], 1.0, PointGetFacing(libAIAI_gv_defenderAI[lp_defenderAIIndex].lv_leashPositions[lv_unitIndex]))), c_orderQueueAddToEnd);
mods/heroesdata.stormmod — base.stormdata/TriggerLibs/GameDataHelperLib.galaxy:11422
lv_i = 1;
for ( ; ( (auto0B10A829_ai >= 0 && lv_i <= auto0B10A829_ae) || (auto0B10A829_ai < 0 && lv_i >= auto0B10A829_ae) ) ; lv_i += auto0B10A829_ai ) {
if ((OrderGetTargetType(UnitOrder(lv_eTC, 0)) == c_orderTargetPoint) && (OrderGetTargetPoint(UnitOrder(lv_eTC, 0)) != null) && (DistanceBetweenPoints(lv_k, lv_t) < 1)) {
UnitBehaviorRemove(EventUnit(), "Powerslide", 1);
break;
mods/heroesdata.stormmod — base.stormdata/TriggerLibs/GameDataHelperLib.galaxy:22047
TriggerEnable(TriggerGetCurrent(), false);
autoA680DF96_val = OrderGetTargetType(EventUnitOrder());
if (autoA680DF96_val == c_orderTargetPoint) {
lv_orderTargetPoint = OrderGetTargetPoint(EventUnitOrder());
mods/heroesdata.stormmod — base.stormdata/TriggerLibs/GameLib.galaxy:14453
while ((UnitHasBehavior2(lv_tauntedUnit, lv_tauntBehavior) == true)) {
if (((OrderGetTargetType(UnitOrder(lv_tauntedUnit, 0)) != c_orderTargetUnit) || (OrderGetTargetUnit(UnitOrder(lv_tauntedUnit, 0)) != lv_casterUnit))) {
UnitCreateEffectUnit(lv_casterUnit, "StormGenericTauntClearTargetOrders", lv_tauntedUnit);
if ((lv_tauntedUnitHasBasicAttackAbility == true)) {
mods/starcoop/starcoop.sc2mod — base.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.sc2mod — base.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.sc2mod — base.sc2data/TriggerLibs/Tactical/TactProtAI.galaxy:1029
curOrder = UnitOrder(aiUnit, 0);
if ((curOrder != null) && (OrderGetAbilityCommand(curOrder) == AbilityCommand(c_AB_ChronoBoost, 0)) && (OrderGetTargetType(curOrder) == c_orderTargetUnit)) {
// should only happen in void with the new chrono boost
curTarget = OrderGetTargetUnit(curOrder);
mods/starcoop/starcoop.sc2mod — base.sc2data/TriggerLibs/Tactical/TactTerrAI.galaxy:1570
curOrder = UnitOrder(aiUnit, 0);
if ((curOrder != null) && (OrderGetAbilityCommand(curOrder) == AbilityCommand("attack", 0)) && (OrderGetTargetType(curOrder) == c_orderTargetUnit)) {
curTarget = OrderGetTargetUnit(curOrder);
}
mods/warcoop/progression/equipments.sc2mod — base.sc2data/LibPEqu.galaxy:33
// Conditions
if (testConds) {
if (!((OrderGetTargetType(EventUnitOrder()) == c_orderTargetUnit))) {
return false;
}