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

enumTemplates()

Return a list of buildable templates for the player...

 

Syntax

var templates = enumTemplates(player);

Parameters

ParameterTypeMandatoryNotesGame version
playerNumber(tick)The player to whose templates should be listed.3.2

Return value

ValueTypeNotesGame version
<templates>Array of
Template Object
If no templates are available, an empty array is returned.3.2
<error>ErrorMost likely an invalid player was specified.3.2

Example

Sort templates by cost
var templates = enumTemplates(me);
 
var byCost = function(a, b) {
	return a.cost - b.cost;
}
 
templates.sort(byCost);
 
var cheapest = templates[0];
 
var mostExpensive = templates[templates.length-1];
Availability 3.2+

Requires:

  • Warzone 3.2 or above
Contents

Jump to: