Other great resources: Official JS API docs, Scripting Forum
DORDER_BUILD
Overview
Instruct a construction droid to build a Structure object at a specific location.
Availability
Warzone 3.1 and above.
Example
// Assuming "truckDroid" contains a DROID_CONSTRUCT object...
// Structure to be built (you need its ID):
var struct = "A0LightFactory"; // Light Factory (for building tanks)
// Check we can build this structure
if (!isStructureAvailable(struct,me)) {
// Pick a suitable location to build it:
var pos = pickStructLocation(truckDroid,struct,truckDroid.x,truckDroid.y);
if (!!pos) {
// Build the structure:
orderDroidBuild(droid,struct,pos.x,pos.y);
} else {
// unable to find suitable building site :(
}
}Notes
The droid's current order can be determined from it's .order property. For more information see Droid object.
You can get structure IDs from the online user guide: Base structures and Defences. Click on any of the structures listed there to get their details page, and the ID is shown near the top.
See also
BEING_BUILT - a structure that's being built
BUILT – a structure that's fully built
BEING_DEMOLISHED – a structure that's being demolished
Droid object – describes a droid object
DROID_CONSTRUCT – a construction droid (truck) capable of building/repairing/demolishing structures
DORDER_DEMOLISH – demolish a structure
DORDER_HELPBUILD – tell a construction droid to help build a structure
DORDER_LINEBUILD – indicates that a construction droid is building a row of structures
orderDroidBuild() – instruct a construction droid to build something
Structure object – describes a structure object