Overview
Excerpt |
---|
This event is triggered when a new technology has been researched by you or an ally. |
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
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
function eventResearched(research |
...
,structure |
...
An event that is run whenever a new research is available. The structure parameter is set if the research comes from a research lab.
research = what has been completed (specified as a Research Object )
...
) {
// 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 | An object describing the structure that completed the research (a research lab), if applicable. If the research was not completed in a lab, this parameter will be undefined. | 3.1 |
Example
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
eventResearched(research,structure) {
if (!!structure) pursueResearch(structure,myResearchPath);
} |
For more information on starting research, see pursueResearch().
See also
- Technology Research – a list of all JS API features relating to research