# Tactical AI - Flee

Grammar — Suggest that who flee from unit from at least distance distance. Optionally passes marker marker info
FlagsNative | 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 — Who
  • unit — From
  • int — Distance
  • marker — Marker

Returns — int

native int AICastFlee(
	unit who,
	unit from,
	int distance,
	marker mark,
);

Category: AI Advanced / Tactical / Actions

# Examples

mods/core.sc2modbase.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.sc2modbase.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.sc2modbase.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.sc2modbase.sc2data/TriggerLibs/Tactical/TactTerrAI.galaxy:1167

    scanCount = UnitGroupCount(targetGroup, c_unitCountAll);
    while (scanCount > 0) {
        AICastFlee(UnitGroupUnit(targetGroup, scanCount), aiUnit, 6, mark);
        scanCount = scanCount - 1;
    }