Other great resources: Official JS API docs, Scripting Forum
setDesign()
- Aubergine
Owned by Aubergine
Enable or disable the design tool...
Â
Syntax
setDesign(enable);
Parameters
Parameter | Type | Mandatory | Description | Game version |
---|---|---|---|---|
enable | Boolean | Should the design tool be enabled?
Default: | 3.1 Beta 1 |
Return value
Value | Type | Description | Game version |
---|---|---|---|
undefined | Undefined | The function always returns undefined | 3.1 Beta 1 |
Notes
This function only affects the user interface for the localhost human player, it does not affect AIs in any way. That being said, AIs should avoid using new droid templates if they don't have a HQ if possible.
Enabling or disabling the design tool automatically shows or hides (as applicable) the DESIGN reticule button:
Example
Enable or disable design tool based on presence of HQ...
function eventStructureBuilt(structure) { if (structure.stattype == HQ) setDesign(true); } function eventDestroyed(gameObj) { if (gameObj.type==STRUCTURE && gameObj.stattype==HQ) setDesign(false); }
Standard game rules require that the design tool is only enabled while the player has a HQ.
Availability 3.1 B1+
Requires:
- Warzone 3.1 Beta 1 or above
Contents
Jump to:
See also
Related articles:
- Mini Map and Design Mode – implementation of standard game rules
- DESIGN – reticule button associated with design tool
- setMiniMap() – turn the radar mini map on or off
- User Interface – quick reference of JS API features relating to user interface
Game mods:
- Structures by Design – ability to design base defence structures in the same way droids are designed.
Â