Home

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

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


Functions

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

Parameters

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

Usage:

if j:__eq( jump.get( "Rhu", "Ruttwi" ) ) then -- Do something

Return value:

true if both jumps are the same.
jump.angle (j)
Gets the angle of a jump in degrees.

Parameters

  • j: Jump to get the angle of.

Usage:

v = j:angle()

Return value:

The angle.
jump.dest (j)
Gets the system that a jump point exits into.

Parameters

  • j: Jump to get the destination of.

Usage:

v = j:dest()

Return value:

The jump's destination system.
jump.exitonly (j)
Checks whether a jump is exit-only.

Parameters

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

Usage:

if jump.exitonly("Eneguoz", "Zied") then -- The jump point in Eneguoz cannot be entered.

Return value:

Whether the jump is exit-only.
jump.get (param)
Gets a jump. Possible values of params:
- string : Gets the jump by system name.
- system : Gets the jump by system.

Parameters

  • param: See description.

Usage:

j,r = jump.get( "Ogat", "Goddard" ) -- Returns the Ogat to Goddard and Goddard to Ogat jumps.

Return value:

Returns the jump and the inverse (where it exits).
jump.hidden (j)
Checks whether a jump is hidden.

Parameters

  • j: Jump to get the hidden status of.

Usage:

if not j:hidden() then -- Exclude hidden jumps.

Return value:

Whether the jump is hidden.
jump.known (j, s)
Checks to see if a jump is known by the player.

Parameters

  • j:
  • s: Jump to check if the player knows.

Usage:

b = j:known()

Return value:

true if the player knows the jump.
jump.pos (j)
Gets the position of the jump in the system.

Parameters

  • j: Jump to get the position of.

Usage:

v = j:pos()

Return value:

The position of the jump in the system as a vec2.
jump.setKnown (j, b)
Sets a jump's known state.

Parameters

  • j: Jump to set known.
  • b: Whether or not to set as known (defaults to true).

Usage:

j:setKnown( false ) -- Makes jump unknown.
jump.system (j)
Gets the system that a jump point exists in.

Parameters

  • j: Jump to get the system of.

Usage:

s = j:system()

Return value:

The jump's system.

Valid XHTML 1.0!