Versions Compared
compared with
Key
- This line was added.
- This line was removed.
- Formatting was changed.
Excerpt |
---|
Check if a droid component is available... |
Syntax
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
componentAvailable(type, name) |
Parameters
Parameter | Type | Mandatory | Notes | Game version | ||
---|---|---|---|---|---|---|
type | Constant | The type of component. These constants are not exposed to JS API – see "Notes" section below. | 3.1 Beta 1 | |||
name | String | The component name. Example: | 3.1 Beta 1 |
Return value
Value | Type | Notes | Game version |
---|---|---|---|
true | Boolean | The component is available for use. | 3.1 Beta 1 |
false | Boolean | The component is not currently available. | 3.1 Beta 1 |
<error> | Error | Invalid parameters. |
Example
to follow3.1 Beta 1 |
Example
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
const COMP_PROPULSION=3;
if (componentAvailable(COMP_PROPULSION, "hover01")) {
// we can build hovercraft!
} |
Div | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
Availability
Requires:
|
Div | ||||
---|---|---|---|---|
| ||||
ContentsJump to:
|