(info) Other great resources: Official JS API docs, Scripting Forum

Working with Construction

<stub page>

Methods of Construction

There are two primary methods of construction in the JS API:

  • orderDroidBuild() – Make a construction droid build the structure, like a player would in the game
  • addStructure() – Instanly place a structure on the map

This guide will look at both of these methods.

Before construction starts...

Before you start building or adding structures to the map, there are some checks to run through...

Is the structure available?

There are several functions that allow you to determine if a structure can be built:

Where can it be built?

 

Droid-built structures

 

Instantly-placed structures