Other great resources: Official JS API docs, Scripting Forum
You are viewing an old version of this page. View the current version.
Compare with Current View Page History
« Previous Version 13 Current »
// Warzone 3.1.0 and earlier componentAvailable(type, name) // Warzone 3.2 and later: the type param is deprecated componentAvailable([type,] name)
The type of component. This parameter is optional in Warzone 3.2 and above.
These constants are not exposed to JS API (#3898) – see "Notes" section below for details.
3.1 Beta 1
Deprecated in 3.2
The component name.
Example: "Spade1Mk1"
"Spade1Mk1"
true
false
Currently, the component type constants aren't exposed to JS API (as of WZ 3.1.0 release). As such, you need to define them manually:
COMP_UNKNOWN
COMP_BODY
COMP_BRAIN
COMP_PROPULSION
COMP_REPAIRUNIT
COMP_ECM
COMP_SENSOR
COMP_CONSTRUCT
COMP_WEAPON
const COMP_PROPULSION = 3; if (componentAvailable(COMP_PROPULSION, "hover01")) { // we can build hovercraft! }
Requires:
Jump to: