Versions Compared
Key
- This line was added.
- This line was removed.
- Formatting was changed.
Excerpt |
---|
Triggered when an oil barrel or artifiact is picked up by a droid... |
Syntax
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
function eventPickup(item, droid) { // do stuff } |
Parameters
Parameter | Type | Mandatory | Notes | Game version |
---|---|---|---|---|
item | Feature object | The item that was picked up. You can look at its .stattype property to find out what it is: | 3.2+ | |
droid | Droid object | The droid that picked up the item. | 3.2+ |
Return value
Warzone does not process the return value of this event.
Notes
When an oil drum is picked up, the 100 power is automatically transferred to your reserves.
When an artifact is picked up, the technology it contains will become available for research - so it's worth checking to see if you have any labs idle. If you've already researched the technology, nothing will happen. It's not possible to determine what the technology is from the item parameter - it's name will always be "Artifact".
Image RemovedImage Added
After picking up the item, the droid will become idle (assuming it's an AI-controlled droid that was ordered to pick the item up) and the item will be destroyed (removed from the map). Note that in eventDestroyed() the feature object's .player property will be the value of 'me', not 12.
In Warzone 3.1, you can determine when items are picked up as they will still trigger eventDestroyed(), however it's difficult to determine which droid (and which player) picked up the item.
Example
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
function eventPickup(item, droid) { switch (item.stattype) { case OIL_DRUM: return console("+100 power"); case ARTIFACT: return console("New research available?"); } } |
Div | ||||||
---|---|---|---|---|---|---|
| ||||||
Availability
Requires:
|
Div | ||||
---|---|---|---|---|
| ||||
ContentsJump to:
|