Other great resources: Official JS API docs, Scripting Forum

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 5 Next »

Overview

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

function eventResearched(research,structure) {
  // do stuff
}

Parameters

ParameterTypeMandatoryDescriptionGame version
researchResearch object(tick)An object describing the research that has been completed.3.1
structureStructure object(error)

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

Set a new research task for the lab that completed current research
eventResearched(research,structure) {
  if (!!structure) pursueResearch(structure,myResearchPath);
}

For more information on starting research, see pursueResearch().

See also

  • No labels