Screeps Creep.attack(): Melee Range, ATTACK Parts, and Return Codes
Use Creep.attack() with the correct range-1 boundary, active ATTACK parts, documented return codes, Rampart behavior, and later-tick verification.
TOPIC · 11 GUIDES
Focused English articles connected to construction, organized with the same filters used by the main article library.
Use Creep.attack() with the correct range-1 boundary, active ATTACK parts, documented return codes, Rampart behavior, and later-tick verification.
Treat ticksToDecay as the next decay pulse, reject unsafe path deadlines, preserve repair() results, explain the current-engine repair-before-decay boundary, and verify EVENT_REPAIR amount and Energy spent on the next tick.
Bind one reviewed boolean change to the exact Rampart, reserve that ID for the tick, record pending evidence only after OK, and verify the same object's isPublic state on the next tick.
Bind confirmation to the exact Extension and owned room, block hostile Creeps and Power Creeps, submit one queued destroy call, then distinguish original-ID removal from a later replacement at the tile.
Report progress and remaining work, submit one tracked build intent, match the exact Builder and Site in the next tick's EVENT_BUILD record, and separate completion from removal.
Set room-specific Wall and Rampart stages, reserve targets across repairers, record only accepted repair calls, and verify the exact Repairer-to-structure EVENT_REPAIR on the next tick.
Preserve a defense Energy reserve, select an ordinary damaged structure, estimate range-adjusted repair to limit over-repair, submit one intent per Tower, then verify exact prior-tick repair events and Energy spent.
Use a one-time Memory request, validate a visible room and 0–49 coordinates, allow Road placement on natural wall terrain, reject an existing Road or Construction Site, respect MAX_CONSTRUCTION_SITES, disable before createConstructionSite(), and verify later.
Confirm RCL 2, place one Extension Construction Site, make Builder1 harvest and build it, and understand progress, capacity, and common failure states.
Give Builder1 a clear priority: build owned sites, repair selected damaged structures, and upgrade the Controller when no higher task exists.
Inspect a misplaced Construction Site, validate its identity, submit remove() once, handle return codes, and verify the result on the next tick.