# Same Command
Grammar — Tells unit secondUnit to do the same action unit firstUnit is currently doing
Flags —Native
|Function
Tells a unit to do the same action that another is currently doing. Returns true if the action succeeded.
# Arguments
unit
— First Unitunit
— Second Unit
Returns — bool
native bool AISameCommand(unit u1, unit u2);
# Related
Category: AI Advanced / Tactical / Functions
- Same Command —
bool
— AISameCommand - Last Attacker —
unit
— AILastAttacker - Last Attack —
int
— AILastAttack - Get Wants To Move Status —
bool
— AIControlWantsToMove - Is Ignored By Wave —
bool
— AIIsIgnoredByWave - Is In Combat —
bool
— AIUnitIsInCombat - Get Cloaked Attacker —
point
— AIGetCloakedAttacker - Get Best Target Point On Group —
point
— AIBestTargetPoint - Find Units —
unitgroup
— AIFindUnits - Get Default Combat Priority —
unit
— AIDefaultCombatPriority - Combat Diff Flag Special High Priority —
bool
— AICombatDiffFlagCatSpecialHighPrio - Combat Diff Flag Splash High Priority —
bool
— AICombatDiffFlagCatSplashHighPrio - Combat Diff Flag Timed Low Priority —
bool
— AICombatDiffFlagCatTimedLowPrio - Combat Diff Flag Workers Normal Priority —
bool
— AICombatDiffFlagCatWorkersNormalPrio - Combat Diff Flag Sort Buildings Priority —
bool
— AICombatDiffFlagCatSortBuildingsPrio - Combat Diff Flag Healers —
bool
— AICombatDiffFlagTieBreakHealers - Combat Diff Flag Low Health —
bool
— AICombatDiffFlagTieBreakLowHP - Combat Diff Flag Bonus Damage —
bool
— AICombatDiffFlagTieBreakBonusDamage - Combat Diff Flag Injured —
bool
— AICombatDiffFlagTieBreakInjured - Combat Diff Flag Detector —
bool
— AICombatDiffFlagTieBreakDetector - Combat Diff Flag Siege Range —
bool
— AICombatDiffFlagTieBreakRange - Does Unit Have Tactical Disabled —
bool
— AIIsTacticalDisabled
# Examples
mods/core.sc2mod — base.sc2data/TriggerLibs/Tactical/TacticalAI.galaxy:267
count = count - 1;
if (AISameCommand(first, test)) {
UnitGroupAdd(dst, test);
}
mods/starcoop/starcoop.sc2mod — base.sc2data/TriggerLibs/Tactical/TacticalAI.galaxy:267
count = count - 1;
if (AISameCommand(first, test)) {
UnitGroupAdd(dst, test);
}