Other great resources: Official JS API docs, Scripting Forum
makeTemplate()
- Aubergine
Owned by Aubergine
Create a fake droid object that can be used to inspect droid attributes prior to production...
Syntax
WZ v3.1
var result = makeTemplate(player, name, body, prop, reserved, t1[, t2[, t3]]);
Parameters
Parameter | Type | Mandatory | Description | Game version |
---|---|---|---|---|
player | Number | The player who would be making the droid. | 3.2 | |
name | String | The name the droid would have. | 3.2 | |
body | String | The body that the droid would use. You can quickly find the ID strings for bodies in the online guide - just click any body and look at "Body ID". | 3.2 | |
prop | String | The propulsion the droid would use. | 3.2 | |
reserved | Null | This property is reserved for future use. Just specify | 3.2 | |
t1 | String | The first turret the droid would have. | 3.2 | |
t2 | String | The second turret the droid would have. | 3.2 | |
t3 | String | The third turret the droid would have. | 3.2 |
Return value
Value | Type | Description | Game version |
---|---|---|---|
<fakeDroid> | Template Object | The object returned will look a bit like a droid object, but it's not. | 3.2 |
null | Null | Not possible for the specified player to build the droid you described. | 3.2 |
<error> | Error | Something went terribly wrong. | 3.2 |
Example
A cyborg engineer template...
// cyborg engineer var myEngineer = makeTemplate( me, // player "Cyb-Engineer", // name "Cyb-Bod-ComEng", // body "CyborgLegs" // propulsion null, // reserved "CyborgSpade" // turret #1 );
Treat as experimental, this function (particularly its return value) could change.
Availability 3.2+
Requires:
- Warzone 3.2 or above
Contents
Jump to:
See also
Related articles:
- Cyborg costs – explains how cyborg prices are calculated
- enumTemplates() – get a list of pre-defined templates available to a player
- enableTemplate() – enable a pre-defined template for a player
- addDroid() – add a droid to the map
- buildDroid() – tell a factory to produce a droid
- getDroidProduction() – work out what a factory is currently building
- eventDroidBuilt() – triggered when the factory finishes building the droid
- getDroidLimit() – determine droid production limits
- Droid object – the object type associated with droids
- Droids – a quick reference for API stuff relating to droids