Naev

Module jump

This module allows you to handle the jumps from Lua.

Generally you do something like:

 j = jump.get("Gamma Polaris", "Apez") -- Get the jump from Gamma Polaris to Apez
 if j:known() then -- The jump is known
    v = j:pos() -- Get the position
    -- Do other stuff
 end
 

Functions

get (src, dest) Gets a jump.
__eq (j, comp) You can use the '==' operator within Lua to compare jumps with this.
pos (j) Gets the position of the jump in the system.
angle (j) Gets the angle of a jump in degrees.
hidden (j) Checks whether a jump is hidden.
exitonly (j) Checks whether a jump is exit-only.
system (j) Gets the system that a jump point exists in.
dest (j) Gets the system that a jump point exits into.
known (j) Checks to see if a jump is known by the player.
setKnown (j[, value=true]) Sets a jump's known state.


Functions

get (src, dest)
Gets a jump.

Possible values of params:
- string : Gets the jump by system name.
- system : Gets the jump by system.
( src, dest )

Parameters:

  • src string or System See description.
  • dest string or System See description.

Returns:

  1. Jump Returns the jump.
  2. Jump Returns the inverse.

Usage:

    j,r  = jump.get( "Ogat", "Goddard" ) -- Returns the Ogat to Goddard and Goddard to Ogat jumps.
__eq (j, comp)
You can use the '==' operator within Lua to compare jumps with this. ( j, comp )

Parameters:

  • j Jump Jump comparing.
  • comp Jump jump to compare against.

Returns:

    boolean true if both jumps are the same.

Usage:

    if j:__eq( jump.get( "Rhu", "Ruttwi" ) ) then -- Do something
pos (j)
Gets the position of the jump in the system. ( j )

Parameters:

  • j Jump Jump to get the position of.

Returns:

    Vec2 The position of the jump in the system.

Usage:

    v = j:pos()
angle (j)
Gets the angle of a jump in degrees. ( j )

Parameters:

  • j Jump Jump to get the angle of.

Returns:

    number The angle.

Usage:

    v = j:angle()
hidden (j)
Checks whether a jump is hidden. ( j )

Parameters:

  • j Jump Jump to get the hidden status of.

Returns:

    boolean Whether the jump is hidden.

Usage:

    if not j:hidden() then -- Exclude hidden jumps.
exitonly (j)
Checks whether a jump is exit-only. ( j )

Parameters:

  • j Jump Jump to get the exit-only status of.

Returns:

    boolean Whether the jump is exit-only.

Usage:

    if jump.exitonly("Eneguoz", "Zied") then -- The jump point in Eneguoz cannot be entered.
system (j)
Gets the system that a jump point exists in. ( j )

Parameters:

  • j Jump Jump to get the system of.

Returns:

    System The jump's system.

Usage:

    s = j:system()
dest (j)
Gets the system that a jump point exits into. ( j )

Parameters:

  • j Jump Jump to get the destination of.

Returns:

    System The jump's destination system.

Usage:

    v = j:dest()
known (j)
Checks to see if a jump is known by the player. ( j )

Parameters:

  • j Jump Jump to check if the player knows.

Returns:

    boolean true if the player knows the jump.

Usage:

    b = j:known()
setKnown (j[, value=true])
Sets a jump's known state. ( j, value )

Parameters:

  • j Jump Jump to set known.
  • value boolean Whether or not to set as known. (default true)

Usage:

    j:setKnown( false ) -- Makes jump unknown.
generated by LDoc 1.4.6 Last updated 2020-10-18 07:14:35