(info) Other great resources: Official JS API docs, Scripting Forum

eventDroidIdle()

Overview

This event is triggered when a droid is twiddling it's turrets because it's got nothing to do.

Unlike the game Dungeon Keeper II you can't slap your imps droids when they are idle, but you can at least set them to work doing something useful to prevent them from getting up to mischief.

Availability

Warzone 3.1 Beta 1 and above

Syntax

function eventDroidIdle(droid) {
  // slap your droid
}

Parameters

ParameterTypeMandatoryDescriptionGame version
droidDroid object(tick)The droid that needs a slap.3.1 Beta 1

Return value

Warzone does not process the event handler's return value.

Example

Droid's next order will depend on type of droid...
function eventDroidIdle(droid) {
  switch (droid.droidType) {
    case DROID_WEAPON: {
      // find it a new target?
      break;
    }
    case DROID_CONSTRUCT: {
      // make it build/repair a structure?
      break;
    }
    case DROID_SENSOR: {
      // make it find a new target?
      break;
    }
    // ...etc...
  }
}

See also

  • .droidType – list of different droid types
  • .order – list of all droid orders exposed by the JS API
  • orderDroid() – give a droid a simple order
  • orderDroidBuild() – order a construction droid to build something
  • orderDroidLoc() – order a droid to do something at a specific location
  • orderDroidObj() – order a droid to do something to a specific game object

Â