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 2 Next »

Overview

This event is triggered when a structure is ready to perform its special ability.

Currently, this only applies to the Laser Satellite Command Post, indicating that your next laser strike is available.

Each time the building is ready to perform its ability, this event will be fired once.

Parameters

NameDescription
structureA structure object describing the building that is ready to perform its special ability.

Example

Fire laser satellite when ready
function findTarget() {
  // do something here to find a target
  return targetObject;
}
 
function eventStructureReady(structure) {
  switch (structure.stattype) {
    case LASSAT: {
      // fire laser satellite
      activateStructure(structure,findTarget());
      break;
    }
    default: {
      // uhm, panic?
    }
  }
} 
  • No labels