Unable to enter an unclaimed green room



  • My creeps are unable to exit room W38S24 to room W38S23. Room W38S23 is the only way out of room W38S24. Room W38S23 is green and has no owner.


    creep.moveTo(new RoomPosition(14, 42, 'W38S23'));

     

    This line gives me error -2 (No path to the target could be found). My creep stops moving at the exit blinking in and out between the two rooms. Is this a bug or a problem in my code? 



  • I have not seen such code so can't comment on that, but if the creep blinks between the two rooms it means it could navigate to the second room, but once its reached the second room, it doesnt know what else to do there.



  • Primoz56 Thank you for your comment.

     

    While blinking between the two rooms, creep.pos shows that the creep is still inside the previous room. 



  • for blinking creeps the 'room' is always one tick off. so if you're looking at the creep at W38S23 it will say W38S24 and vice versa.

    you can force move a creep into the room so its not on the edge with the moveTo command and this artefact should go away. anything beyond that would be issues with your code.

    basically a creep on the edge will shift rooms indefinately with no commands given. most likely you are not giving it commands to move off the edge (like it may be pathing along the edge, or back through the other room etc)



  • Turned out I was skipping rooms I don't own inside my main loop. Fixed now. Primoz56 Thank you. 🙂