Home

Module naev

Naev generic Lua bindings. An example would be:
 if naev.lang() == "en" then
 --Language is English.
 end
 

Functions

naev.eventStart (evtname) Starts an event, does not start check conditions.
naev.keyDisableAll () Disables all inputs.
naev.keyEnable (keyname, enable) Disables or enables a specific keybinding.
naev.keyEnableAll () Enables all inputs.
naev.keyGet (keyname) Gets the keybinding value by name.
naev.lang () Gets the language Naev is currently using.
naev.missionStart (misnname) Starts a mission, does no check start conditions.
naev.ticks () Gets the SDL ticks.


Functions

naev.eventStart (evtname)
Starts an event, does not start check conditions.

Parameters

  • evtname: Name of the event to start.

Usage:

naev.eventStart( "Some Event" )

Return value:

true on success.
naev.keyDisableAll ()
Disables all inputs.

Usage:

naev.keyDisableAll() -- Disables all inputs
naev.keyEnable (keyname, enable)
Disables or enables a specific keybinding. Use with caution, this can make the player get stuck.

Parameters

  • keyname: Name of the key to disable (for example "accel").
  • enable: Whether to enable or disable (if omitted disables).

Usage:

naev.keyEnable( "accel", false ) -- Disables the acceleration key
naev.keyEnableAll ()
Enables all inputs.

Usage:

naev.keyEnableAll() -- Enables all inputs
naev.keyGet (keyname)
Gets the keybinding value by name.

Parameters

  • keyname: Name of the keybinding to get value of.

Usage:

bindname = naev.keyGet( "accel" )
naev.lang ()
Gets the language Naev is currently using.

Usage:

if naev.lang() == "en" then -- Language is english

Return value:

Two character identifier of the language.
naev.missionStart (misnname)
Starts a mission, does no check start conditions.

Parameters

  • misnname: Name of the mission to start.

Usage:

naev.missionStart( "Some Mission" )

Return value:

true on success.
naev.ticks ()
Gets the SDL ticks. Useful for doing timing on Lua functions.

Return value:

The SDL ticks since the application started running.

Valid XHTML 1.0!