Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

...

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

Syntax

Code Block
themeEclipse
languagejavascript
linenumberstrue
function eventStructureReady(structure) {
  // do stuff
}

Parameters

NameTypeDescription
structureStructure objectThe building that is ready to perform its special ability.

...

Code Block
themeEclipse
languagejavascript
titleFire laser satellite when ready
linenumberstrue
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?
    }
  }
} 

See also

  • structureIdle() – you can use this to manually check whether a structure is idle