Other great resources: Official JS API docs, Scripting Forum
eventResearched()
- Aubergine
Owned by Aubergine
Triggered when a new technology has been researched by you or an ally...
Overview
The event is also triggered when you gain technology by picking up an artefact (something that an AI cannot currently do, but a human ally can).
Syntax
function eventResearched(research, structure) { // do stuff }
Parameters
Parameter | Type | Mandatory | Description | Game version |
---|---|---|---|---|
research | Research object | An object describing the research that has been completed. | 3.1 | |
structure | Structure object | If the research was completed in one of your labs, this will be the structure object for that RESEARCH lab. The parameter will be undefined if the research was completed by one of your allies, or gifted via a script, etc. | 3.1 |
Example
Set a new research task for the lab that completed current research
eventResearched(research, structure) { if (structure) pursueResearch(structure, myResearchPath); }
Availability STABLE
Requires:
- Warzone 3.1 Beta 1 or above
Contents
Jump to:
See also
Related articles:
- pursueResearch() – tell one of your labs to research something
- Research & Technology – a list of all JS API features relating to research