3

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}?

1 Answer 1

4

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.

2
  • Can I do rangedHeal and heal at the same time? Commented May 5, 2015 at 23:42
  • @TheNumberOne No, you can't, they use the same body part.
    – artch
    Commented May 6, 2015 at 7:06

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .