# Lane Waypoint Get Closest Lane
Flags —
Native
|Function
Finds the lane closest to TestPoint (note this function can be called any time and is not dependent on “Lane Waypoint Calc Closest Data For Lane”).
# Arguments
point
— TestPoint
Returns — int
native int AILaneWaypointGetClosestLane(point testPoint);
# Related
Category: AI Advanced / Lane / Functions
- Lane Waypoint Get Closest Lane —
int
— AILaneWaypointGetClosestLane - Lane Waypoint Get Calc Data Closest Waypoint Index —
int
— AILaneWaypointGetCalcDataClosestWaypointIndex - Lane Waypoint Get Calc Data Second Waypoint Index —
int
— AILaneWaypointGetCalcDataSecondWaypointIndex - Lane Waypoint Get Calc Data Closest Point —
point
— AILaneWaypointGetCalcDataClosestPoint - Lane Waypoint Get Calc Data Closest Dist —
fixed
— AILaneWaypointGetCalcDataClosestDist
# Examples
mods/heroes.stormmod — base.stormmaps/maps/heroes/singleplayermaps/startingexperience/tutorialveteran.stormmap/MapScript.galaxy:6808
}
if ((AILaneWaypointGetClosestLane(UnitGetPosition(libStEx_gv_hERO_EnemyFalstad)) == gv__2B_CurrentLane)) {
TriggerEnable(TriggerGetCurrent(), true);
return true;
mods/heroes.stormmod/base.stormmaps/maps/heroes/singleplayermaps/startingexperience/tutorialveteran.stormmap — MapScript.galaxy:6808
}
if ((AILaneWaypointGetClosestLane(UnitGetPosition(libStEx_gv_hERO_EnemyFalstad)) == gv__2B_CurrentLane)) {
TriggerEnable(TriggerGetCurrent(), true);
return true;
mods/heroesdata.stormmod — base.stormdata/TriggerLibs/GameLib.galaxy:19027
}
libAIAI_gf_AITeamDelegateUpdateFortKeepcountinLaneforTeam(lv_victimTeam, AILaneWaypointGetClosestLane(UnitGetPosition(lv_dyingStructureUnit)));
return true;
}
mods/heroesmapmods/battlegroundmapmods/infernalshrines.stormmod — base.stormdata/LibMSHE.galaxy:642
libGame_gf_CalculateSpawnedMinionGoalPoints(lp_team, UnitGetPosition(lv_monster));
libAIAI_gf_MinionAIStartMinionAI(-1, lv_monster, libGame_gv_spawnedMinionLane, libGame_gv_spawnedMinionFirstWaypointIndex, false, true, false, lv_enemyTeam, false);
libMSHE_gv_mMDiabloShrinesPunisherPushLane = AILaneWaypointGetClosestLane(UnitGetPosition(lv_monster));
}
mods/heromods/thefirelords.stormmod — base.stormdata/LibHMaj.galaxy:595
}
lv_targetLane = AILaneWaypointGetClosestLane(lv_targetPoint);
lv_unitCounter = 1;
for ( ; ( (autoEA04AE5C_ai >= 0 && lv_unitCounter <= autoEA04AE5C_ae) || (autoEA04AE5C_ai < 0 && lv_unitCounter >= autoEA04AE5C_ae) ) ; lv_unitCounter += autoEA04AE5C_ai ) {