-
Notifications
You must be signed in to change notification settings - Fork 13
Navigationmanager
fxfire edited this page Apr 24, 2014
·
1 revision
- The NavigationManager holds all functions and information for navigation.
- this is a work in progress..
- Example:
local pos = Player.pos
d("Our Player is standing on the Navmesh: ".. tostring(NavigationManager:IsOnMesh(pos.x,pos.y,pos.z)))
- :GetPath(x1,y1,z1,x2,y2,z2)
- Takes in 6 numbers and tries to calculate a navigationpath from position x1,y1,z1 to position x2,y2,z2. Returns a lua table with multiple positions if a path was successfully found. (lua table)
- :IsOnMesh(x,y,z)
- Returns if the position x,y,z is on the navmesh (up to 3 ingame units away from the navmesh is still considered to be on the navmesh) (boolean).
- :IsOnMeshExact()
- Returns if the position x,y,z is on the navmesh (boolean).
- :GetNavMeshName()
- Returns the currently loaded navmesh name (string).
- :UnloadNavMesh()
- Unloads the currently loaded navmesh (boolean).
- :LoadNavmesh(string)
- Loads the navmesh (.obj) at the location passed as string. HINT: Use GetStartupPath() to get the directory path to where ffxivminion was launched. (boolean).
- :SaveNavmesh(string)
- Saves the navmesh (.obj) at the location passed as string. HINT: Use GetStartupPath() to get the directory path to where ffxivminion was launched. (boolean).
- :ShowNavMesh(boolean)
- Toggles the visibility of the Navmesh (boolean).
- :ShowNavPath(boolean)
- Toggles the visibility of the Navpath (boolean).
- :GetRandomPointOnCircle(x,y,z,minradius,maxradius)
- Tries to find a random point at position x,y,z inbetween the min- and maxradius. Returns a lua table which holds the random point or nil if none was found (lua table).
- :GetPointToMeshDistance(x,y,z)
- Returns how far the passed position x,y,z is away from the nearest navmesh-point (number).
- :GetClosestPointOnMesh(x,y,z)
- Returns the nearest position on the navmesh from this point x,y,z. (lua table).
- :AddNavObstacles(args)
- Adds one or more obstacles that the navigationsystem will not pass trough. "args" is a lua table where each entry has coordinates x,y,z and radius r. Example: [1] = { x=321,y=1234,z=444,r=12 }. (lua table).
- :ClearNavObstacles()
- Deletes all obstacles.
- :SetAvoidanceAreas(args)
- Adds one or more avoidance areas that the navigationsystem will treat as "very high costs to walk through them" and therefore most likely find another way around."args" is a lua table where each entry has coordinates x,y,z and radius r. Example: [1] = { x=321,y=1234,z=444,r=12 }. (lua table).
- :ClearAvoidanceAreas()
- Clears all avoidance areas.
-1 : Startpoint not on navmesh
-2 : Endpoint not on navmesh
-3 : No path between start and endpoint found
-4 : Path between start and endpoint has a lenght of 0
-5 : No path between start and endpoint found
-6 : Couldn't find a path
-7 : Distance Playerpos-Targetpos < stoppingthreshold
-8 : NavMesh is nor ready/loaded
-9 : Player object not valid
-10 : Moveto coordinates are crap
-11 : Doomsday ;)