How to Debug spawnCreep() Return Codes in Screeps
Validate the Spawn, Creep name, body, Energy, Memory, and optional structures; run dryRun first; preserve the real spawnCreep() result; and map each error code to a concrete fix.
ARTICLE LIBRARY
Browse 64 published guides by system, difficulty, content type, or topic. Start with What Is Screeps? A Programming Strategy Game or follow the beginner sequence through How to Combine Your First Screeps Room Loop.
5 matching guides
Validate the Spawn, Creep name, body, Energy, Memory, and optional structures; run dryRun first; preserve the real spawnCreep() result; and map each error code to a concrete fix.
Distinguish current Energy from room capacity, repeat a role-specific body unit, enforce the 50-part limit, calculate cost and spawn time, and decide when to spawn a smaller emergency body.
Count current live harvesters, choose one idle active Spawn, require a minimum WORK-CARRY-MOVE body, use a unique name and dryRun, and prevent multiple Spawns from submitting duplicate recovery requests.
Calculate the TTL and Energy gained per renewal, reject CLAIM Creeps, require explicit Boost removal approval, coordinate Spawn time, move adjacent, stop at a target TTL, and handle every documented result.
Use an explicit one-time confirmation request, validate the named Spawn and Creep, move adjacent, submit recycleCreep() once, avoid an automatic suicide fallback, and verify disappearance and resource drops on the next tick.
English articles are published only after source review, official API checks where applicable, JavaScript syntax review where code is present, duplicate-intent checks, and a final score of at least 96.