# AI Pathing Cost Unit
Grammar — Pathing cost for unit unit to point to, considering buildings of type type
Flags —Native
|Function
Returns the pathing cost from a unit.
# Arguments
unit
— Unitpoint
— Tobool
[ preset::AIPathBlockType ] — Type
Returns — int
native int AIPathingCostUnit(
unit u,
point to,
bool ignoreEnemyBuildings,
);
# Related
Category: AI Advanced / Utility / Functions
- [F] —
bool
— Is Point In Shrub — ( InShrub ) - [F] —
bool
— Is Campaign AI — ( AIIsCampaign ) - [F] —
unit
— Grab Unit — ( AIGrabUnit ) - [F] —
int
— Get State — ( AIState ) - [F] —
bool
— Get Flag — ( AIGetFlag ) - [F] —
bool
— Get Coop Flag — ( AIGetCoopFlag ) - [F] —
bool
— Unit Has AI Option — ( UnitGetAIOption ) - [F] —
bool
— Wants To Surrender — ( AIGivingUp ) - [F] —
int
— AI Pathing Cost Map — ( AIPathingCostMap ) - [F] —
int
— AI Pathing Cost Unit — ( AIPathingCostUnit ) - [F] —
point
— AI Self Reinforce Point — ( AISelfReinforceDropPoint )
# Examples
# mods/starcoop/starcoop.sc2mod
// L3767
AIPathingCostUnit(lp_attacker, UnitGetPosition(lv_currentattacktargetunit), c_ignoreEnemyBuildings)
# mods/starcoop/starcoop.sc2mod
// L4284
AIPathingCostUnit(lv_birthingUnit, PlayerStartLocation(1), c_ignoreEnemyBuildings)
// L5742
AIPathingCostUnit(UnitGroupUnit(UnitGroupSelected(1), 1), PlayerStartLocation(1), c_ignoreEnemyBuildings)
# mods/starcoop/starcoop.sc2mod
// L1579
AIPathingCostUnit (aiUnit, AIWaveGoal(AIUnitGetWave(aiUnit)), true)
// L1604
AIPathingCostUnit (aiUnit, AIWaveGoal(AIUnitGetWave(aiUnit)), true)