Screeps Harvest Energy: Your First Creep Script
Make one named Screeps Creep find a Source, move into range, and harvest Energy with a small script you can verify across later ticks.
TOPIC · 10 GUIDES
Focused English articles connected to movement, organized with the same filters used by the main article library.
10 matching guides
Make one named Screeps Creep find a Source, move into range, and harvest Energy with a small script you can verify across later ticks.
Inspect one Creep's active WORK, CARRY, and MOVE parts, then use its action result, Store, fatigue, and damage to diagnose missing abilities.
Recover a stored Source ID first, distinguish FIND_SOURCES from FIND_SOURCES_ACTIVE, build reachable path candidates, rank path length before assignment count and stable ID, store the selected identity, handle empty Sources according to a documented dynamic policy, and preserve harvest and movement results.
Identify which action returned ERR_NOT_IN_RANGE, use its real range, save the moveTo() result separately, and retry the original action on a later tick instead of assuming movement is immediate.
Distinguish an accepted movement order from later position change, validate the target and active MOVE parts, inspect fatigue and range, track roomName:x:y across ticks, and diagnose traffic, cached paths, and overwritten movement orders.
Distinguish ERR_NO_PATH, ERR_NOT_FOUND and PathFinder incomplete results; validate target range; correct CostMatrix walkability; inspect callbacks, maxOps, maxRooms and cross-room routes; and separate temporary traffic from a failed search.
Calculate unboosted Creep movement from MOVE recovery, loaded body weight, road, plain, and swamp costs; account for empty CARRY parts; and separate a static body estimate from live multi-tick movement proof.
Choose between getRangeTo(), inRangeTo(), isNearTo(), isEqualTo(), findClosestByRange(), findClosestByPath(), and findInRange() without confusing linear range with route reachability.
Use Game.map.findRoute() as a room-level plan, assign routeCallback costs, reject rooms deliberately, validate the first exit step, rebuild after room transitions, and keep route preference separate from live safety intel.
Use CostMatrix values 0–255 correctly, classify roads and structures, separate invisible rooms from blocked rooms, layer dynamic Creep costs, validate coordinates, and reject incomplete PathFinder results.