Double spawning with two spawns?



  • So recently I had my room level up to RCL7 and I got a second spawn. My multi-room code works by looking at spawns, and I have variables that look at a number of creeps. But since creeps that are being spawned have no memory, and that spawning doesnt use all the energy in extensions, the second spawn makes a creep, which results in it going over the limit.

    • else if(numberOfBuilders < 1){
    • name = Game.spawns[spawnName].createCustomCreep(energy,'Builder')
    • numberOfBuilders++
    • }


  • I assume your talking about https://screeps.com/a/#!/room/shard3/E43N11

    Its hard to tell from such a small snipit, you may find you get a bit more dynamic help on Slack in #help. Its probably going to come down to how you are tracking the number of builders. If your just Filtering for 'living' creeps and going off that count for both spawns without adding the new creep into the roles then yes, it'll be off. Have to account for it with your code, either by 'adding' the new creep to the list your using, or changing up how you spawn.