# Tactical AI - Flee
Grammar — Suggest that who flee from unit from at least distance distance. Optionally passes marker marker info
Flags —Native
|Action
Tells a unit to flee from another unit at least the specified distance. The Marker parameter is optional, pass in null if you don’t want to use it.
# Arguments
unit
— Whounit
— Fromint
— Distancemarker
— Marker
Returns — int
native int AICastFlee(
unit who,
unit from,
int distance,
marker mark,
);
# Related
Category: AI Advanced / Tactical / Actions
- Set Ignored By Wave —
void
— AISetIgnoredByWave - Clear Cloaked Attacker —
void
— AIClearCloakedAttacker - Tactical AI - Cast —
int
— AICast - Tactical AI - Flee —
int
— AICastFlee - Call Original Tactical AI Think —
void
— AIBaseThink - Call Unit Ability Tactical Script —
void
— AIExecuteAbilTactical - Set Tactical AI Range —
void
— libNtve_gf_SetTacticalAIRange - Set Tactical AI Think —
void
— libNtve_gf_SetTacticalAIThink - Enable/Disable Tactical For Unit —
void
— AISetUnitTacticalDisabled - Enable/Disable Tactical For Unit Group —
void
— AISetGroupTacticalDisabled
# Examples
mods/core.sc2mod — base.sc2data/TriggerLibs/Tactical/TactTerrAI.galaxy:1174
scanCount = UnitGroupCount(targetGroup, c_unitCountAll);
while (scanCount > 0) {
AICastFlee(UnitGroupUnit(targetGroup, scanCount), aiUnit, 6, mark);
scanCount = scanCount - 1;
}
mods/core.sc2mod — base.sc2data/TriggerLibs/Tactical/TactTerrAI.galaxy:1194
scanCount = UnitGroupCount(targetGroup, c_unitCountAll);
while (scanCount > 0) {
AICastFlee(UnitGroupUnit(targetGroup, scanCount), aiUnit, 6, mark);
scanCount = scanCount - 1;
}
mods/starcoop/starcoop.sc2mod — base.sc2data/TriggerLibs/Tactical/TactTerrAI.galaxy:1147
scanCount = UnitGroupCount(targetGroup, c_unitCountAll);
while (scanCount > 0) {
AICastFlee(UnitGroupUnit(targetGroup, scanCount), aiUnit, 6, mark);
scanCount = scanCount - 1;
}
mods/starcoop/starcoop.sc2mod — base.sc2data/TriggerLibs/Tactical/TactTerrAI.galaxy:1167
scanCount = UnitGroupCount(targetGroup, c_unitCountAll);
while (scanCount > 0) {
AICastFlee(UnitGroupUnit(targetGroup, scanCount), aiUnit, 6, mark);
scanCount = scanCount - 1;
}