Inherits:Perk
Section:status
Priority:100
StatusPerk grants functions related to the unit's status.
Settings common to all units are written in the “system.status” section of the global settings.
{ "system": { "status": { "options": { "waitForTimeout": Number, } } } }
Unit-specific settings are written in the “status” section.
{ "status": { "options": { "waitForTimeout": Number, }, "waitFor": { <eventName>: [{ <unit>: (See basic.locate skill for valid values), "status": String, }, ...], ... } } }
Type:String
The event name. In this event, a unit waits for other units to become the specific status. Valid event names are BitsmistJS events or standard Javascript events.
The value is an array of objects, each specifying which unit should become which status. The unit waits for all the units specified in the array.
default:“ready”
The status to wait for. A unit waits for another unit to be this status. If not specified, it waits for the unit to be “ready” status.
The unit to wait for. Valid values are the same as the target argument of the basic.locate skill.
Type:Number
Default:10000
The time in milliseconds before timeout when using the wait spell.
Loads the settings from the “status.waitFor” section and installs event handlers to wait for other units.
Type:String
Target:Instance
The current status of this unit. It can be changed using the change skill. Valid statuses are as follows:
Type:Undefined
Target:Unit
Changes the unit's status.
Parameter | Type | Description |
---|---|---|
status | String | The unit's status. See State - status for valid values. |
None.
Type:Undefined
Target:Unit
Waits for other units to be specific status.
Parameter | Type | Description |
---|---|---|
waitList Required | Array of Object | The wait info array. Each object in the array is equivalent to the settings set as a value for <eventName>. |
timeout Default:(see desc) | Number | The timeout in milliseconds. If the unit is not in the specified status after the time specified here, an exception is raised. If not specified, waitForTimeout setting value is used. |
None.