Difference between revisions of "Oolite JavaScript Reference: EquipmentInfo"

From Elite Wiki
(New page: {{Oolite-script-item-future|class|1.72|test}} <small>'''Prototype:''' <code>Object</code></small><br /> '''<code>EquipmentInfo</code>''' objects provide information about a type of equipm...)
 
(Properties)
Line 19: Line 19:
 
  '''equipmentKey''' : String (read-only)
 
  '''equipmentKey''' : String (read-only)
 
The equipment key for the equipment described by this <code>EquipmentInfo</code> object. For EQ_MISSILE, this is "EQ_MISSILE".
 
The equipment key for the equipment described by this <code>EquipmentInfo</code> object. For EQ_MISSILE, this is "EQ_MISSILE".
 +
 +
=== <code>incompatibleEquipment</code> ===
 +
'''incompatibleEquipment''' : Array (read-only)
 +
An array of equipment keys (in arbitrary order). In order to be installed, no item in this array may already be installed.
 +
 +
'''See also:''' <code>[[#requiresAnyEquipment|requiresAnyEquipment]]</code>, <code>[[#requiresEquipment|requiresEquipment]]</code>
 +
 +
=== <code>isAvailableToAll</code> ===
 +
'''isAvailableToAll''' : Boolean (read-only)
 +
 +
=== <code>isExternalStore</code> ===
 +
'''isExternalStore''' : Boolean (read-only)
 +
True for _MISSILE and _MINE equipment types.
 +
 +
=== <code>isPortableBetweenShips</code> ===
 +
'''isPortableBetweenShips''' : Boolean (read-only)
  
 
=== <code>name</code> ===
 
=== <code>name</code> ===
Line 24: Line 40:
 
The display name for the equipment described by this <code>EquipmentInfo</code> object. This string is localized. For EQ_MISSILE in English, this is "Missile".
 
The display name for the equipment described by this <code>EquipmentInfo</code> object. This string is localized. For EQ_MISSILE in English, this is "Missile".
  
=== <code>techLevel</code> ===
+
=== <code>price</code> ===
  '''techLevel''' : Number (read-only nonnegative integer)
+
  '''price''' : Number (read-only nonnegative integer)
The raw tech level required to purchase this item. Unlike <code>[[#effectiveTechLevel|effectiveTechLevel]]</code>, this does not take the special meaning of 99 and <code>TL_FOR_EQ_WHATEVER</code> mission variables into account.
+
 
 +
=== <code>requiredCargoSpace</code> ===
 +
'''requiredCargoSpace''' : Number (read-only nonnegative integer)
 +
 
 +
=== <code>requiresAnyEquipment</code> ===
 +
'''requiresAnyEquipment''' : Array (read-only)
 +
An array of equipment keys (in arbitrary order). In order to be installed, ''at least one'' item in this array must already be installed.
 +
 
 +
'''See also:''' <code>[[#incompatibleEquipment|incompatibleEquipment]]</code>, <code>[[#requiresEquipment|requiresEquipment]]</code>
 +
 
 +
=== <code>requiresCleanLegalRecord</code> ===
 +
'''requiresCleanLegalRecord''' : Boolean (read-only)
  
'''See also: <code>[[#effectiveTechLevel|effectiveTechLevel]]</code>
+
'''See also:''' <code>[[#requiresNonCleanLegalRecord|requiresNonCleanLegalRecord]]</code>
  
=== <code>price</code> ===
 
=== <code>isAvailableToAll</code> ===
 
 
=== <code>requiresEmptyPylon</code> ===
 
=== <code>requiresEmptyPylon</code> ===
 +
'''requiresEmptyPylon''' : Boolean (read-only)
 +
True for equipment that requires at least one pylon to have nothing on it.
 +
 +
'''See also:''' <code>[[#requiresMountedPylon|requiresMountedPylon]]</code>
 +
 +
=== <code>requiresEquipment</code> ===
 +
'''requiresEquipment''' : Array (read-only)
 +
An array of equipment keys (in arbitrary order). In order to be installed, ''all'' items in this array must already be installed.
 +
 +
'''See also:''' <code>[[#incompatibleEquipment|incompatibleEquipment]]</code>, <code>[[#requiresAnyEquipment|requiresAnyEquipment]]</code>
 +
 +
=== <code>requiresFreePassengerBerth</code> ===
 +
'''requiresFreePassengerBerth''' : Boolean (read-only)
 +
 +
=== <code>requiresFullFuel</code> ===
 +
'''requiresFullFuel''' : Boolean (read-only)
 +
 +
'''See also:''' <code>[[#requiresNonFullFuel|requiresNonFullFuel]]</code>
 +
 
=== <code>requiresMountedPylon</code> ===
 
=== <code>requiresMountedPylon</code> ===
=== <code>requiresCleanLegalRecord</code> ===
+
'''requiresMountedPylon''' : Boolean (read-only)
 +
True for equipment that requires at least one pylon to have a store (missile, mine or equipment) on it.
 +
 
 +
'''See also:''' <code>[[#requiresEmptyPylon|requiresEmptyPylon]]</code>
 +
 
 
=== <code>requiresNonCleanLegalRecord</code> ===
 
=== <code>requiresNonCleanLegalRecord</code> ===
=== <code>requiresFreePassengerBerth</code> ===
+
'''requiresNonCleanLegalRecord''' : Boolean (read-only)
=== <code>requiresFullFuel</code> ===
+
 
 +
'''See also:''' <code>[[#requiresCleanLegalRecord|requiresCleanLegalRecord]]</code>
 +
 
 
=== <code>requiresNonFullFuel</code> ===
 
=== <code>requiresNonFullFuel</code> ===
=== <code>isExternalStore</code> ===
+
'''requiresNonFullFuel''' : Boolean (read-only)
=== <code>isPortableBetweenShips</code> ===
+
 
=== <code>requiredCargoSpace</code> ===
+
'''See also:''' <code>[[#requiresFullFuel|requiresFullFuel]]</code>
=== <code>requiresEquipment</code> ===
+
 
=== <code>requiresAnyEquipment</code> ===
+
=== <code>techLevel</code> ===
=== <code>incompatibleEquipment</code> ===
+
'''techLevel''' : Number (read-only nonnegative integer)
 +
The raw tech level required to purchase this item. Unlike <code>[[#effectiveTechLevel|effectiveTechLevel]]</code>, this does not take the special meaning of 99 and <code>TL_FOR_EQ_WHATEVER</code> mission variables into account.
 +
 
 +
'''See also: <code>[[#effectiveTechLevel|effectiveTechLevel]]</code>
  
 
== Static methods ==
 
== Static methods ==

Revision as of 23:02, 17 October 2008

Prototype: Object

EquipmentInfo objects provide information about a type of equipment. To acquire an EquipmentInfo object, use the infoForKey() method, as in:

var missileInfo = EquipmentInfo.infoForKey("EQ_MISSILE");

Properties

description

description : String (read-only)

A short description of the equipment, as seen on the Ship Outfitting screen.

effectiveTechLevel

effectiveTechLevel : Number (read/write nonnegative integer)

The effective tech level required to purchase this item. Unlike techLevel, this takes the special meaning of 99 and TL_FOR_EQ_WHATEVER mission variables into account. If the raw tech level is 99, changing the value of effectiveTechLevel is equivalent to setting the appropriate TL_FOR_EQ_WHATEVER mission variable. If the raw tech level is not 99, changes to effectiveTechLevel are ignored.

See also: techLevel

equipmentKey

equipmentKey : String (read-only)

The equipment key for the equipment described by this EquipmentInfo object. For EQ_MISSILE, this is "EQ_MISSILE".

incompatibleEquipment

incompatibleEquipment : Array (read-only)

An array of equipment keys (in arbitrary order). In order to be installed, no item in this array may already be installed.

See also: requiresAnyEquipment, requiresEquipment

isAvailableToAll

isAvailableToAll : Boolean (read-only)

isExternalStore

isExternalStore : Boolean (read-only)

True for _MISSILE and _MINE equipment types.

isPortableBetweenShips

isPortableBetweenShips : Boolean (read-only)

name

name : String (read-only)

The display name for the equipment described by this EquipmentInfo object. This string is localized. For EQ_MISSILE in English, this is "Missile".

price

price : Number (read-only nonnegative integer)

requiredCargoSpace

requiredCargoSpace : Number (read-only nonnegative integer)

requiresAnyEquipment

requiresAnyEquipment : Array (read-only)

An array of equipment keys (in arbitrary order). In order to be installed, at least one item in this array must already be installed.

See also: incompatibleEquipment, requiresEquipment

requiresCleanLegalRecord

requiresCleanLegalRecord : Boolean (read-only)

See also: requiresNonCleanLegalRecord

requiresEmptyPylon

requiresEmptyPylon : Boolean (read-only)

True for equipment that requires at least one pylon to have nothing on it.

See also: requiresMountedPylon

requiresEquipment

requiresEquipment : Array (read-only)

An array of equipment keys (in arbitrary order). In order to be installed, all items in this array must already be installed.

See also: incompatibleEquipment, requiresAnyEquipment

requiresFreePassengerBerth

requiresFreePassengerBerth : Boolean (read-only)

requiresFullFuel

requiresFullFuel : Boolean (read-only)

See also: requiresNonFullFuel

requiresMountedPylon

requiresMountedPylon : Boolean (read-only)

True for equipment that requires at least one pylon to have a store (missile, mine or equipment) on it.

See also: requiresEmptyPylon

requiresNonCleanLegalRecord

requiresNonCleanLegalRecord : Boolean (read-only)

See also: requiresCleanLegalRecord

requiresNonFullFuel

requiresNonFullFuel : Boolean (read-only)

See also: requiresFullFuel

techLevel

techLevel : Number (read-only nonnegative integer)

The raw tech level required to purchase this item. Unlike effectiveTechLevel, this does not take the special meaning of 99 and TL_FOR_EQ_WHATEVER mission variables into account.

See also: effectiveTechLevel

Static methods

infoForKey

function infoForKey(equipmentKey : String) : EquipmentInfo

Returns the equipment info object for a given type of equipment, or null for an unrecognised key. Example: var missileInfo = EquipmentInfo.infoForKey("EQ_MISSILE");