NavRoute: Difference between revisions
(11 intermediate revisions by 5 users not shown) | |||
Line 1: | Line 1: | ||
=== | == Functions == | ||
'''Definition:''' | === add === | ||
'''Definition:'''<br> | |||
add() -> ? | |||
<br><br> | <br><br> | ||
'''Description:''' | '''Description:''' <br> | ||
<br><br> | <br><br> | ||
'''Arguments:''' | '''Arguments:''' <br> | ||
? | |||
<br><br> | <br><br> | ||
'''Returns:''' | '''Returns:''' <br> | ||
? | |||
<br><br> | <br><br> | ||
'''Example:''' | '''Example:''' | ||
<br><br> | <br><br> | ||
=== addbyid === | === addbyid === | ||
'''Definition:'''<br> | '''Definition:'''<br> | ||
addbyid(int | addbyid(int [[sectorid]]) -> true | ||
<br><br> | <br><br> | ||
'''Description:'''<br> | '''Description:''' <br> | ||
Add a | Add a waypoint to the navigation route. | ||
<br> | |||
sectorid equal or lower than 0 generates an error. | |||
<br><br> | <br><br> | ||
'''Arguments:'''<br> | '''Arguments:''' <br> | ||
'' | ''[[sectorid]]'' - sector to plot a route to | ||
<br><br> | <br><br> | ||
'''Returns:''' | '''Returns:''' <br> | ||
Seems to always return true. | |||
<br><br> | <br><br> | ||
'''Example:'''< | '''Example:''' | ||
local | <source lang="lua"> | ||
NavRoute.addbyid | local sectorid = SectorIDFromLocationStr("Bractus C-5") | ||
NavRoute.addbyid(sectorid) | |||
</source> | |||
<br><br> | <br><br> | ||
=== | |||
'''Definition:''' | |||
=== clear === | |||
'''Definition:'''<br> | |||
clear() -> Clear the current route | |||
<br><br> | <br><br> | ||
'''Description:''' | '''Description:''' <br> | ||
Will clear any route if one exists | |||
<br><br> | <br><br> | ||
'''Arguments:''' | '''Arguments:''' <br> | ||
None | |||
<br><br> | <br><br> | ||
'''Returns:''' | '''Returns:''' <br> | ||
Nil | |||
<br><br> | <br><br> | ||
'''Example:''' | '''Example:''' | ||
<br><br> | <br><br> | ||
=== | === GetCurrentRoute === | ||
'''Definition:''' | '''Definition:'''<br> | ||
GetCurrentRoute() -> table route | |||
<br><br> | <br><br> | ||
'''Description:''' | '''Description:''' <br> | ||
Returns current nav route. Note: The return value is a reference to the navroute not a copy. That means the returned table is updated as the route changes and the route can be edited by modifying the table elements. | |||
<br><br> | <br><br> | ||
''' | '''Returns:''' <br> | ||
'''route''' reference to navroute table | |||
<br><br> | <br><br> | ||
''' | |||
<br> | === GetFinalDestination === | ||
'''Definition:'''<br> | |||
GetFinalDestination() -> ? | |||
<br><br> | <br><br> | ||
'''Description:''' <br> | |||
<br><br> | <br><br> | ||
''' | '''Arguments:''' <br> | ||
? | |||
<br><br> | <br><br> | ||
''' | '''Returns:''' <br> | ||
sector-id of route end | |||
<br><br> | <br><br> | ||
'''Example:''' | '''Example:''' | ||
<br><br> | <br><br> | ||
=== | === GetNextHop === | ||
'''Definition:''' | '''Definition:'''<br> | ||
GetNextHop() -> ? | |||
<br><br> | <br><br> | ||
'''Description:''' | '''Description:''' <br> | ||
<br><br> | <br><br> | ||
'''Arguments:''' | '''Arguments:''' <br> | ||
? | |||
<br><br> | <br><br> | ||
'''Returns:''' | '''Returns:''' <br> | ||
? | |||
<br><br> | <br><br> | ||
'''Example:''' | '''Example:''' | ||
<br><br> | <br><br> | ||
=== list === | === list === | ||
'''Definition:''' | '''Definition:'''<br> | ||
list() -> ? | |||
<br><br> | <br><br> | ||
'''Description:''' | '''Description:''' <br> | ||
<br><br> | <br><br> | ||
'''Arguments:''' | '''Arguments:''' <br> | ||
? | |||
<br><br> | <br><br> | ||
'''Returns:''' | '''Returns:''' <br> | ||
? | |||
<br><br> | <br><br> | ||
'''Example:''' | '''Example:''' | ||
<br><br> | <br><br> | ||
=== | |||
'''Definition:''' | |||
=== load === | |||
'''Definition:'''<br> | |||
load() -> ? | |||
<br><br> | <br><br> | ||
'''Description:'''<br> | '''Description:''' <br> | ||
<br><br> | <br><br> | ||
'''Arguments:'''<br> | '''Arguments:''' <br> | ||
? | |||
<br><br> | <br><br> | ||
'''Returns:''' | '''Returns:''' <br> | ||
? | |||
<br><br> | <br><br> | ||
'''Example:''' | '''Example:''' | ||
<br><br> | <br><br> | ||
=== | |||
'''Definition:''' | |||
=== OnEvent === | |||
'''Definition:'''<br> | |||
OnEvent() -> ? | |||
<br><br> | <br><br> | ||
'''Description:''' | '''Description:''' <br> | ||
<br><br> | <br><br> | ||
'''Arguments:''' | '''Arguments:''' <br> | ||
? | |||
<br><br> | <br><br> | ||
'''Returns:''' | '''Returns:''' <br> | ||
? | |||
<br><br> | <br><br> | ||
'''Example:''' | '''Example:''' | ||
<br><br> | <br><br> | ||
=== | |||
'''Definition:''' | |||
=== save === | |||
'''Definition:'''<br> | |||
save() -> ? | |||
<br><br> | <br><br> | ||
'''Description:''' | '''Description:''' <br> | ||
<br><br> | <br><br> | ||
'''Arguments:''' | '''Arguments:''' <br> | ||
? | |||
<br><br> | <br><br> | ||
'''Returns:''' | '''Returns:''' <br> | ||
? | |||
<br><br> | <br><br> | ||
'''Example:''' | '''Example:''' | ||
<br><br> | <br><br> | ||
=== | |||
'''Definition:''' | |||
<br> | === SetFinalDestination === | ||
'''Definition:'''<br> | |||
SetFinalDestination(int destination) -> nil | |||
<br><br> | <br><br> | ||
''' | '''Description:''' <br> | ||
Plot navroute to specified sector. | |||
<br><br> | <br><br> | ||
''' | '''Arguments:''' <br> | ||
''destination'' - [[sectorid]] of destination sector. | |||
<br><br> | <br><br> | ||
'''Example:''' | '''Example:''' | ||
<br>< | <br> | ||
<source lang="lua"> | |||
NavRoute.SetFinalDestination(SectorIDFromLocationStr"Dau A1") | |||
</source> | |||
=== | === SetFullRoute === | ||
'''Definition:''' | '''Definition:'''<br> | ||
<br> | SetFullRoute(table route) -> nil | ||
<br><br> | <br><br> | ||
''' | '''Description:''' <br> | ||
Set the navigation route by specifying all it's points. | |||
<br><br> | <br><br> | ||
''' | '''Arguments:''' <br> | ||
''route'' - list containing [[sectorid]]'s describing the navroute.<br> | |||
Calling it with arguments of wrong type (not table) causes Lua errors that cripple the HUD. | |||
<br><br> | <br><br> | ||
'''Example:''' | '''Example:''' | ||
<source lang="lua"> | |||
local sectorid = SectorIDFromLocationStr("Bractus C-5") | |||
NavRoute.SetFullRoute({sectorid, sectorid+1, 1234}) | |||
</source> | |||
<br><br> | <br><br> | ||
=== | === undo === | ||
'''Definition:''' | '''Definition:'''<br> | ||
undo() -> ? | |||
<br><br> | <br><br> | ||
'''Description:''' | '''Description:''' <br> | ||
<br><br> | <br><br> | ||
'''Arguments:''' | '''Arguments:''' <br> | ||
? | |||
<br><br> | <br><br> | ||
'''Returns:''' | '''Returns:''' <br> | ||
? | |||
<br><br> | <br><br> | ||
'''Example:''' | '''Example:''' | ||
<br><br> | <br><br> | ||
[[Category:Tables]] |
Latest revision as of 05:11, 13 July 2009
Functions
add
Definition:
add() -> ?
Description:
Arguments:
?
Returns:
?
Example:
addbyid
Definition:
addbyid(int sectorid) -> true
Description:
Add a waypoint to the navigation route.
sectorid equal or lower than 0 generates an error.
Arguments:
sectorid - sector to plot a route to
Returns:
Seems to always return true.
Example:
<source lang="lua">
local sectorid = SectorIDFromLocationStr("Bractus C-5")
NavRoute.addbyid(sectorid)
</source>
clear
Definition:
clear() -> Clear the current route
Description:
Will clear any route if one exists
Arguments:
None
Returns:
Nil
Example:
GetCurrentRoute
Definition:
GetCurrentRoute() -> table route
Description:
Returns current nav route. Note: The return value is a reference to the navroute not a copy. That means the returned table is updated as the route changes and the route can be edited by modifying the table elements.
Returns:
route reference to navroute table
GetFinalDestination
Definition:
GetFinalDestination() -> ?
Description:
Arguments:
?
Returns:
sector-id of route end
Example:
GetNextHop
Definition:
GetNextHop() -> ?
Description:
Arguments:
?
Returns:
?
Example:
list
Definition:
list() -> ?
Description:
Arguments:
?
Returns:
?
Example:
load
Definition:
load() -> ?
Description:
Arguments:
?
Returns:
?
Example:
OnEvent
Definition:
OnEvent() -> ?
Description:
Arguments:
?
Returns:
?
Example:
save
Definition:
save() -> ?
Description:
Arguments:
?
Returns:
?
Example:
SetFinalDestination
Definition:
SetFinalDestination(int destination) -> nil
Description:
Plot navroute to specified sector.
Arguments:
destination - sectorid of destination sector.
Example:
<source lang="lua">
NavRoute.SetFinalDestination(SectorIDFromLocationStr"Dau A1")
</source>
SetFullRoute
Definition:
SetFullRoute(table route) -> nil
Description:
Set the navigation route by specifying all it's points.
Arguments:
route - list containing sectorid's describing the navroute.
Calling it with arguments of wrong type (not table) causes Lua errors that cripple the HUD.
Example:
<source lang="lua">
local sectorid = SectorIDFromLocationStr("Bractus C-5")
NavRoute.SetFullRoute({sectorid, sectorid+1, 1234})
</source>
undo
Definition:
undo() -> ?
Description:
Arguments:
?
Returns:
?
Example: