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

__eq (j, comp) You can use the '==' operator within Lua to compare jumps with this.
__tostring (j) Converts a jump to readable form.
angle (j) Gets the angle of a jump in radians.
dest (j) Gets the system that a jump point exits into.
exitonly (j) Checks whether a jump is exit-only.
get (src, dest) Gets a jump.
hidden (j) Checks whether a jump is hidden.
hide (j) Gets the hide value of a jump in radians.
jumpDist (j, p) Gets the distance from the jump point at which the pilot can jump.
known (j) Checks to see if a jump is known by the player.
pos (j) Gets the position of the jump in the system.
radius (j) Gets the jump's radius.
reverse (j) Gets the opposite jump.
setKnown (j[, value=true]) Sets a jump's known state.
system (j) Gets the system that a jump point exists in.


Functions

__eq (j, comp)
You can use the '==' operator within Lua to compare jumps with this.

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
    
__tostring (j)
Converts a jump to readable form. Mainly meant to be used for printing.

Parameters:

  • j Jump Jump to print.
angle (j)
Gets the angle of a jump in radians.

Parameters:

  • j Jump Jump to get the angle of.

Returns:

    number The angle.

Usage:

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

Parameters:

  • j Jump Jump to get the destination of.

Returns:

    System The jump's destination system.

Usage:

    v = j:dest()
    
exitonly (j)
Checks whether a jump is exit-only.

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.
    
get (src, dest)

Gets a jump.

Possible values of params:

- string : Gets the jump by system name. <br/>
- system : Gets the jump by system. <br/>

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.
    
hidden (j)
Checks whether a jump is hidden.

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.
    
hide (j)
Gets the hide value of a jump in radians.

Parameters:

  • j Jump Jump to get the hide value of.

Returns:

    number The hide value.

Usage:

    v = j:hide()
    
jumpDist (j, p)
Gets the distance from the jump point at which the pilot can jump.

Parameters:

  • j Jump Jump to get the jump distance of.
  • p Pilot Pilot to get information for.

Returns:

    number The distance from the jump at which the pilot can jump.

Usage:

    d = j:jumpDist( player.pilot() )
    
known (j)
Checks to see if a jump is known by the player.

Parameters:

  • j Jump Jump to check if the player knows.

Returns:

    boolean true if the player knows the jump.

Usage:

    b = j:known()
    
pos (j)
Gets the position of the jump in the system.

Parameters:

  • j Jump Jump to get the position of.

Returns:

    Vec2 The position of the jump in the system.

Usage:

    v = j:pos()
    
radius (j)
Gets the jump's radius.

Parameters:

  • j Jump Jump to get the radius of.

Returns:

    number The jump's radius.

Usage:

    radius = j:radius()
    
reverse (j)
Gets the opposite jump.

Parameters:

  • j Jump Jump to get the reverse jump of.

Returns:

    Jump The jump in the opposite direction.
setKnown (j[, value=true])
Sets a jump's known state.

Note that this affects both sides of the jump connection to avoid getting the player locked away.

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.
    
system (j)
Gets the system that a jump point exists in.

Parameters:

  • j Jump Jump to get the system of.

Returns:

    System The jump's system.

Usage:

    s = j:system()
    
generated by LDoc 1.5.0 Last updated 2025-05-08 17:02:59