Naev

Module outfit

Lua bindings to interact with outfits.

This will allow you to create and manipulate outfits in-game.

An example would be:

 o = outfit.get( "Heavy Laser" ) -- Gets the outfit by name
 cpuusage = o:cpu() -- Gets the cpu usage of the outfit
 slotname, slot_size = o:slot() -- Gets slot information about the outfit
 

Functions

__eq (o1, o2) Checks to see if two outfits are the same.
get (s) Gets a outfit
get (s) Gets a outfit if it exists, nil otherwise.
getAll () Gets all the outfits.
name (s) Gets the translated name of the outfit.
nameRaw (s) Gets the raw (untranslated) name of the outfit.
shortname (s) Gets the translated short name of the outfit.
type (o) Gets the type of an outfit.
typeBroad (o) Gets the broad type of an outfit.
cpu (o) Gets the cpu usage of an outfit.
mass (o) Gets the mass of an outfit.
heatFor (heatup) Calculates a heat value to be used with heat up.
slot (o) Gets the slot name, size and property of an outfit.
limit (o) Gets the limit string of the outfit.
icon (o) Gets the store icon for an outfit.
price (o) Gets the price of an outfit.
description (o[, p=player.pilot()]) Gets the description of an outfit (translated).
summary (o[, p=player.pilot()[, noname=false]]) Gets the summary of an outfit (translated).
unique (o) Gets whether or not an outfit is unique
friendlyfire (o) Gets whether or not a weapon outfit can do friendly fire.
pointdefense (o) Gets whether or not a weapon outfit is point defense.
missShips (o) Gets whether or not a weapon outfit misses ships.
missAsteroids (o) Gets whether or not a weapon outfit misses asteroids.
toggleable (o) Gets whether or not an outfit is toggleable.
shipstat (o[, name=nil[, internal=false]]) Gets a shipstat from an Outfit by name, or a table containing all the ship stats if not specified.
weapstats (o[, p=nil]) Computes statistics for weapons.
specificstats () Returns raw data specific to each outfit type.
illegality (Outfit) Gets the factions to which the outfit is illegal to.
tags (o[, tag=nil]) Gets the outfit tags.


Functions

__eq (o1, o2)
Checks to see if two outfits are the same.

Parameters:

  • o1 Outfit First outfit to compare.
  • o2 Outfit Second outfit to compare.

Returns:

    boolean true if both outfits are the same.

Usage:

    if o1 == o2 then -- Checks to see if outfit o1 and o2 are the same
    
get (s)
Gets a outfit Will raise an error if fails.

Parameters:

  • s string Raw (untranslated) name of the outfit to get.

Returns:

    Outfit or nil The outfit matching name or nil if error.

Usage:

    s = outfit.get( "Heavy Laser" ) -- Gets the heavy laser
    
get (s)
Gets a outfit if it exists, nil otherwise.

Does not raise any warnings or errors if fails.

Parameters:

  • s string Raw (untranslated) name of the outfit to get.

Returns:

    Outfit or nil The outfit matching name or nil if not found

Usage:

    s = outfit.exists( "Heavy Laser" ) -- Gets the heavy laser if it
    exists
    
getAll ()
Gets all the outfits.

Returns:

    Table Table containing all the outfits.
name (s)
Gets the translated name of the outfit.

This translated name should be used for display purposes (e.g. messages). It cannot be used as an identifier for the outfit; for that, use outfit.nameRaw() instead.

Parameters:

  • s Outfit Outfit to get the translated name of.

Returns:

    string The translated name of the outfit.

Usage:

    outfitname = o:name() -- Equivalent to _(o:nameRaw())
    
nameRaw (s)
Gets the raw (untranslated) name of the outfit.

This untranslated name should be used for identification purposes (e.g. can be passed to outfit.get()). It should not be used directly for display purposes without manually translating it with _().

Parameters:

  • s Outfit Outfit to get the raw name of.

Returns:

    string The raw name of the outfit.

Usage:

    outfitrawname = o:nameRaw()
    
shortname (s)
Gets the translated short name of the outfit.

This translated name should be used when you have abbreviate the outfit greatly, e.g., the GUI. In the case the outfit has no special shortname, it's equivalent to outfit.name().

Parameters:

  • s Outfit Outfit to get the translated short name of.

Returns:

    string The translated short name of the outfit.
type (o)
Gets the type of an outfit.

Parameters:

  • o Outfit Outfit to get information of.

Returns:

    string The name of the outfit type (in English).

Usage:

    print( o:type() ) -- Prints the type of the outfit
    
typeBroad (o)
Gets the broad type of an outfit.

This name is more generic and vague than type().

Parameters:

  • o Outfit Outfit to get information of.

Returns:

    string The name of the outfit broad type (in English).

Usage:

    print( o:typeBroad() ) -- Prints the broad type of the outfit
    
cpu (o)
Gets the cpu usage of an outfit.

Parameters:

  • o Outfit Outfit to get information of.

Returns:

    string The amount of cpu the outfit uses.

Usage:

    print( o:cpu() ) -- Prints the cpu usage of an outfit
    
mass (o)
Gets the mass of an outfit.

Parameters:

  • o Outfit Outfit to get information of.

Returns:

    string The amount of mass the outfit uses.

Usage:

    print( o:mass() ) -- Prints the mass of an outfit
    
heatFor (heatup)
Calculates a heat value to be used with heat up.

Note Outfits need mass to be able to heat up, with no mass they will fail to heat up.

Parameters:

  • heatup Number How many "pulses" are needed to heat up to 800 kelvin. Each pulse can represent a discrete event or per second if multiplied by dt.

Returns:

    Number The heat value corresponding to the number of pulses.
slot (o)
Gets the slot name, size and property of an outfit.

Parameters:

  • o Outfit Outfit to get information of.

Returns:

  1. string Human readable name (in English).
  2. string Human readable size (in English).
  3. string Human readable property (in English).
  4. boolean Slot is required.
  5. boolean Slot is exclusive.

Usage:

    slot_name, slot_size, slot_prop = o:slot() -- Gets an outfit's slot
    info
    
limit (o)
Gets the limit string of the outfit. Only one outfit can be equipped at the same time for each limit string.

Parameters:

  • o Outfit Outfit to get information of.

Returns:

    string or nil Limit string or nil if not applicable.
icon (o)
Gets the store icon for an outfit.

Parameters:

  • o Outfit Outfit to get information of.

Returns:

    Tex The texture containing the icon of the outfit.

Usage:

    ico = o:icon() -- Gets the shop icon for an outfit
    
price (o)
Gets the price of an outfit.

Parameters:

  • o outfit or String Outfit to get the price of.

Returns:

    number The price, in credits.

Usage:

    price = o:price()
    
description (o[, p=player.pilot()])
Gets the description of an outfit (translated).

Parameters:

  • o outfit or String Outfit to get the description of.
  • p Pilot Pilot to set description to. (default player.pilot())

Returns:

    string The description (with translating).

Usage:

    description = o:description()
    
summary (o[, p=player.pilot()[, noname=false]])
Gets the summary of an outfit (translated).

Parameters:

  • o outfit or String Outfit to get the summary of.
  • p Pilot Pilot to set summary to. (default player.pilot())
  • noname string Whether or not to hide the outfit name at the top. (default false)

Returns:

    string The summary (with translating).

Usage:

    summary = o:summary()
    
unique (o)
Gets whether or not an outfit is unique

Parameters:

  • o outfit or String Outfit to get the uniqueness of.

Returns:

    boolean The uniqueness of the outfit.

Usage:

    isunique = o:unique()
    
friendlyfire (o)
Gets whether or not a weapon outfit can do friendly fire.

Parameters:

  • o outfit or String Outfit to get the property of of.

Returns:

    boolean Whether or not the outfit can do friendly fire damage.
pointdefense (o)
Gets whether or not a weapon outfit is point defense.

Parameters:

  • o outfit or String Outfit to get the property of of.

Returns:

    boolean Whether or not the outfit is point defense.
missShips (o)
Gets whether or not a weapon outfit misses ships.

Parameters:

  • o outfit or String Outfit to get the property of of.

Returns:

    boolean Whether or not the outfit misses ships.
missAsteroids (o)
Gets whether or not a weapon outfit misses asteroids.

Parameters:

  • o outfit or String Outfit to get the property of of.

Returns:

    boolean Whether or not the outfit misses asteroids.
toggleable (o)
Gets whether or not an outfit is toggleable.

Parameters:

  • o outfit or String Outfit to get the property of of.

Returns:

    boolean Whether or not the outfit is toggleable.
shipstat (o[, name=nil[, internal=false]])
Gets a shipstat from an Outfit by name, or a table containing all the ship stats if not specified. if name is not specified.

Parameters:

  • o Outfit Outfit to get ship stat of.
  • name string Name of the ship stat to get. (default nil)
  • internal boolean Whether or not to use the internal representation. (default false)

Returns:

    Value of the ship stat or a tale containing all the ship stats
weapstats (o[, p=nil])
Computes statistics for weapons.

Parameters:

  • o Outfit Outfit to compute for.
  • p Pilot Pilot to use ship stats when computing. (default nil)

Returns:

  1. number Damage per secondof the outfit.
  2. number Disable per second of the outfit.
  3. number Energy per second of the outfit.
  4. number Range of the outfit.
  5. number trackmin Minimum tracking value of the outfit.
  6. number trackmax Maximum tracking value of the outfit.
  7. number lockon Time to lockon.
specificstats ()
Returns raw data specific to each outfit type.

Returns:

    A table containing the raw values.
illegality (Outfit)
Gets the factions to which the outfit is illegal to.

Parameters:

  • Outfit o to get illegality status of.

Returns:

    table Table of all the factions the outfit is illegal to.
tags (o[, tag=nil])
Gets the outfit tags.

Parameters:

  • o Outfit Outfit to get tags of.
  • tag string Tag to check if exists. (default nil)

Returns:

    table or boolean Table of tags where the name is the key and true is the value or a boolean value if a string is passed as the second parameter indicating whether or not the specified tag exists.

Usage:

    if o:tags["fancy"] then -- Has "fancy" tag
    
generated by LDoc 1.5.0 Last updated 2024-12-13 16:37:51