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

getDroidProduction()

Determine what droid, if any, a factory is currently producing...

 

Syntax

var fakeDroid = getDroidProduction(factory);

Parameters

ParameterTypeMandatoryNotesGame Version
factoryStructure object(tick)

The structure object associated with the factory to check.

Valid structure types are:

  • FACTORY – capable of producing wheeled, half-tracked, tracked and hover propulsion droids
  • VTOL_FACTORY – capable of producing VTOLs (lift propulsion)
  • CYBORG_FACTORY – capable of producing cyborgs (cyborg legs propulsion)
3.2

Return values

ValueTypeNotesGame Version
<fakeDroid>Fake Droid object

If the factory is producing a droid, an fake droid object will be returned describing the properties of that droid.

You cannot use this droid object with any other functions, it's for information purposes only. Listen to eventDroidBuilt() to get the real droid object once production is complete.

3.2
nullNull

If the factory isn't producing anything, the function returns null.

Note: You can also use structureIdle() to determine if a factory is idle (not producing anything)

3.2
<error>ErrorInvalid parameters, or the factory was destroyed.3.2

Example

Build a list of all current factory production activities....
var production = []; // will contain list of droids being built
 
var factoryTypes = [FACTORY, VTOL_FACTORY, CYBORG_FACTORY];
 
var fakeDroid;
 
factoryTypes.forEach( function getListOf(factories) {
	enumStruct(me, factories).forEach( function inspect(factory) {
		fakeDroid = getDroidProduction(factory);
		if (fakeDroid) production.push[fakeDroid];
	} );
} );
Availability 3.2+

Requires:

  • Warzone 3.2 and above.
Contents

Jump to:

See also

Related articles:

  • buildDroid() – tell a factory to build a droid
  • eventDroidBuilt() – triggered when a factory finishes building a droid
  • getDroidLimit() – determine droid production limits
  • Droid object – the object type associated with droids
  • Droids – a quick reference for API stuff relating to droids

Â