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 6 Current »

Scenario

I've sent a droid for repairs (or rearming if a VTOL) – how do I monitor it's progress?

Requirements

 You'll need backport.daction.js and backport.dorder.js backports depending on game version.

Solution

The easiest thing to do is wait for eventDroidIdle() to be triggered once the repairs/rearming is complete.

However, you can keep track of every stage of the repair process by looking at the properties of the Droid object.

If the .order property is DORDER_RTRDORDER_RTR_SPECIFIED or DORDER_REARM, the droid hasn't yet been repaired/rearmed.

You can determine what stage of the repair/rearm process the droid is at by looking at it's .action property:

  • DACTION_MOVETOREPAIR or DACTION_MOVETOREARM – the droid is still travelling to the repair facility or rearming pad
  • DACTION_WAITFORREPAIR or DACTION_WAITFORREARM – the droid has arrived at facility/pad, but it's had to join a queue of other droids waiting for repairs/rearming
  • DACTION_MOVETOREPAIRPOINT or DACTION_MOVETOREARMPOINT – the droid is now moving to the facility or landing on the pad
  • DACTION_WAITDURINGREPAIR or DACTION_WAITDURINGREARM – repairs/rearming is in progress

As repairs are being performed, the droid's .health property will increase towards 100, and if it's a VTOL it's .armed property will also increase towards 100.

Once repairs/rearming is complete, the following will happen:

  • Land units will move to the repair facility rally point
  • VTOLs will either continue their last mission or if the previous mission was completed they'll remain on the rearming pad.

Note that VTOLs are sometimes told to move away from a rearming pad (eg. if they are repaired and another VTOL needs the pad, or if a land unit is trying to move across the pad). In this scenario the droid action will be DACTION_CLEARREARMPAD.

  • No labels