StructureSpawn.spawning not updated same tick



  • If StrutureSpawn.createCreep creates a creep within in that exact tick shouldn't StructureSpawn.spawning also be set to the spawning object as well? Otherwise you end up creating 5 dumby creeps because they have no way of easily checking if the Spawner already has a creep being spawned...



  • StructureSpawn.createCreep does not create a creep that very tick. Like all commands, it actually begins on the next tick. Unfortunately only Creeps allow you to cancel a pending order (it would be nice if that could change), and if you want to remember what orders you have made this tick you need to keep track of it yourself.

    What does happen immediately when you use the createCreep command is the adding of the optional memory object into Memory. But the actual creep creation has not begun, and so StructureSpawn.spawning is correctly false. It's not hard for you to manage your own flag on whether you have ordered a creep this tick or not.