Instantly place a droid on the map...

 

Syntax

// Warzone 3.1 syntax
addDroid(player, x, y, name, body, propulsion, reserved, droidType, t1[, t2[, t3]]);
 
// Warzone 3.2 syntax -- droidType no longer required
addDroid(player, x, y, name, body, propulsion, reserved, null, t1[, t2[, t3]]);

Parameters

ParameterTypeMandatoryNotesAvailability
playerNumber(tick)The ID of the player who will own the droid.
xNumber(tick)The x co-ordinate (tile) where the droid should be added.
yNumber(tick)The y co-ordinate (tile) where the droid should be added.
nameString(tick)The name of the droid.
bodyString(tick)The body component.
propulsionString(tick)The propulsion component.
reservedNull(tick)Not currently used, specify null.
droidType

Constant

Null

(tick) 3.1

(error) 3.2+

On Warzone 3.1 branch, a droidType must be specified:

Note: DROID_ANY is not a valid value.

On Warzone 3.2 and above, the droidType is no longer required as Warzone will work it out automatically.

Not required in 3.2.

t1String(tick)The first turret to attach to the droid.
t2String(error)The second, optional, turret to attach to the droid.
t3String(error)The third, optional, turret to attach to the droid.

Return values

ValueTypeNotesAvailability
<droid>Droid objectOn Warzone 3.2 and above, if the droid is created its associated droid object will be returned.
nullNullIn Warzone 3.2 and above, if the droid is not created, null is returned.
trueBooleanIn Warzone 3.1 branch, true is returned if the droid was created.
falseBooleanIn Warzone 3.1 branch, false is returned if the droid was created.
<error>ErrorMost likely invalid parameters.

Notes

If this function is used in a multiplayer game, a desync will occur.

If you're making cyborg engineers or mechanics on Warzone 3.1, there is a bug with the droidType parameter – see notes in buildDroid() for more information and how to work around it.

Unlike buildDroid(), this function places the droid on the map instantly at no cost to the player. In addition, there are no checks on which turrets are specified – so, for example, you can put non-VTOL turrets on VTOLs (pic from NoQ):

Examples

Anyone want to post an example?

This function is broken in Warzone 3.1.0 and earlier releases.

Availability

Requires:

  • Warzone 3.1 Beta 1
  • Improved and bug-fixed in Warzone 3.2
Contents

Jump to: