Search code examples
screeps

Sequence of actions for screeps


I've looked the web for info about what can I do in the current turn with my creep, and I found conflicting statements.

http://screeps.wikia.com/wiki/Creep -- from comments here, we can build and move at the same turn, or move then transfer energy

http://www.reddit.com/r/screeps/comments/2pqhsz/gaps_in_the_documentation/ -- and this source states that I can do only one action with animation, that is, I can't move and build at the same turn. And as far as I get it, it states that I need to do animation action first, then any of other actions.

Which is right?

Questions I raise here:

  • Given I'm 4 tiles far from enemy, can I move in and shoot at the same turn?

  • Given I'm 3 tiles far from enemy, can I shoot and move out at the same turn?

  • Given questions above, which creep moves first, mine, or enemy? Can I have a situation, when creep shot and move out of my range before I can shoot back? Or all actions are performed at the same time?

  • Can any action happen between robot move and rangeAttack?

  • I have 5 creeps with CARRY in a line. Can I transferEnergy from first to second, from second to third, ..., from four to five in a same turn?

  • What happens when I order to transferEnergy twice in a turn? Which one of this two invocations work?

  • Can I move and attack/build at the same turn?

  • Can I rangeAttack and attack at the same turn?


Solution

  • Actually, these questions are about gameplay, not coding, so you better ask it on Arqade (another StackExchange project) rather than StackOverflow.

    Given I'm 4 tiles far from enemy, can I move in and shoot at the same turn?

    No.

    Given I'm 3 tiles far from enemy, can I shoot and move out at the same turn?

    Yes.

    Given questions above, which creep moves first, mine, or enemy?

    They move both simultaneously.

    Can I have a situation, when creep shot and move out of my range before I can shoot back?

    No. If you get such situation - that's a bug, report it.

    Or all actions are performed at the same time?

    Exactly.

    Can any action happen between robot move and rangeAttack?

    Moving is performed after all other actions during dedicated movement game step.

    I have 5 creeps with CARRY in a line. Can I transferEnergy from first to second, from second to third, ..., from four to five in a same turn?

    No, you have to do it in 5 turns.

    What happens when I order to transferEnergy twice in a turn? Which one of this two invocations work?

    The last one. The same with all other actions.

    Can I move and attack/build at the same turn?

    Yes.

    Can I rangeAttack and attack at the same turn?

    Yes. But you can't heal and rangedHeal at the same time though.