Are any Actions of Screeps mutually exclusive to eachother?

Are any Actions of Screeps mutually exclusive to eachother? - Dandy fancy jackets with shiny ties on dummies in showroom of contemporary male shop

I have designed a guard screep with ATTACK, RANGED_ATTACK, HEAL, and MOVE. My script executes each of these actions at valid targets (heal the guard next to me, while attacking the hostile creep in front of me, while ranged attacking the hostile healer behind him), but it seems that not all the actions are firing every tick. It seems that the guard that is healing, fails to either attack or fire.

I modified the guard to only HEAL and RANGED_ATTACK, but even then it seems that while healing, he doesn't RANGED_ATTACK. I believe I've seen the HOSTILES HEAL and RANGED_ATTACK at the same time. Perhaps it's an error in my script, but my question is:

Are there mutually exclusive actions in the set of {HEAL, ATTACK, RANGED_ATTACK, and MOVE}?



Best Answer

As mentioned in unofficial Screeps Wiki here:

Creeps will get several actions scheduled to execute per tick. These will then be executed in a fixed order. Not all actions can be executed, for example a creep can't heal and attack in 1 tick.

  • dropEnergy
  • transferEnergy
  • pickup
  • heal or repair or build or attack or harvest
  • rangedAttack or rangedHeal
  • suicide

Important to note is that rangedAttack is separate from attack and heal. A creep can therefore do both in 1 tick.

So yes, you can't do at the same time:

  • attack and heal;
  • attack and repair;
  • repair and build;
  • rangedAttack and rangedHeal.

You can do:

  • rangedAttack and heal;
  • rangedAttack and attack;
  • attack and transferEnergy.

It worth noting that move is always allowed, it doesn't affect any other actions.




Pictures about "Are any Actions of Screeps mutually exclusive to eachother?"

Are any Actions of Screeps mutually exclusive to eachother? - Man Holding Red Cube
Are any Actions of Screeps mutually exclusive to eachother? - Photography of Gold Watch
Are any Actions of Screeps mutually exclusive to eachother? - Watch Face of Gold Watch





Probability - Mutually Exclusive Events - Example | Don't Memorise




Sources: Stack Exchange - This article follows the attribution requirements of Stack Exchange and is licensed under CC BY-SA 3.0.

Images: Andrea Piacquadio, Phils Wei, Antony Trivet, Antony Trivet