Other great resources: Official JS API docs, Scripting Forum

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 6 Next »

Check if a droid component is available...

 

Syntax

componentAvailable(type, name)

Parameters

ParameterTypeMandatoryNotesGame version
typeConstant(tick)

The type of component.

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

const COMP_PROPULSION=3; 

if (componentAvailable(COMP_PROPULSION, "hover01")) {
	// we can build hovercraft!
}
Availability 3.1 B1+

Requires:

  • Warzone 3.1 Beta 1 or above
Contents

Jump to:

 

  • No labels