Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Excerpt

Check if a droid component is available...

 

Syntax

Code Block
themeRDark
languagejavascript
linenumberstrue
componentAvailable(type, name)

Parameters

ParameterTypeMandatoryNotesGame version
typeConstant(tick)

The type of component.(warning)

Note

These constants are not exposed to JS API – see "Notes" section below.

3.1 Beta 1
nameString(tick)

The component name.

Example: "Spade1Mk1"

3.1 Beta 1

Return value

ValueTypeNotesGame version
trueBooleanThe component is available for use.3.1 Beta 1
falseBooleanThe component is not currently available.3.1 Beta 1
<error>ErrorInvalid parameters.3.1 Beta 1

Example

Code Block
themeRDark
languagejavascript
linenumberstrue
const COMP_PROPULSION=3; 

if (componentAvailable(COMP_PROPULSION, "hover01")) {
	// we can build hovercraft!
}
Div
classbox
Availability
Status
colourGreen
title3.1 b1+

Requires:

  • Warzone 3.1 Beta 1 or above
Div
classbox
Contents

Jump to:

Table of Contents
maxLevel5