Other great resources: Official JS API docs, Scripting Forum
enumResearch()
- Aubergine
Owned by Aubergine
List all technologies that can you can start researching immediately...
Â
Syntax
var technologies = enumResearch();
Parameters
The function does not have any parameters.
Return values
Value | Type | Notes | Game Version |
---|---|---|---|
<technologies> | Array of Research object | If technologies are available for research, an array of their associated research objects will be returned. | 3.1 Beta 1 |
[] | Empty Array | If no technologies are currently available for research, an empty array is returned. | 3.1 Beta 1 |
<error> | Error | Internal error | 3.1 Beta 1 |
Example
Get labs to research whatever is available...
// get list of technologies available for research var technologies = enumResearch(); Â // do we have stuff to research? if (technologies.length) { // get a list of labs var labs = enumStruct( me, RESEARCH_LAB ); Â labs.forEach( function(lab) { // is lab idle? if ( (lab.status == BUILT) && structureIdle(lab) ) { // make it research first technology in list pursueResearch( lab, technologies.shift() ); } } ); }
Availability 3.1 B1+
Requires:
- Warzone 3.1 Beta 1 or above
Contents
Jump to:
See also
Related articles:
- findResearch() – find the research path to a given technology
- pursueResearch()– tell a lab to research something
- enableResearch() – enable a technology so that it can be researched
- completeResearch() – immediately complete research for a given technology
- eventResearched() – triggered when a technology has been researched
- RESEARCH – user interface research button
- Research & Technology – more JS API features relating to research
Â