What you will complete in this lesson
Your first worker has already harvested Energy and delivered it to a Spawn. This lesson explains why those actions depend on different body parts and gives you one read-only diagnostic for checking the Creep you actually have.
By the end, you should be able to separate four different causes of a failed action:
- the required body part was never added;
- the part exists but has been fully damaged;
- the ability exists, but range, fatigue, Store, or target state prevents the action;
- the tutorial name does not match a live Creep.
Lesson boundary: this lesson covers only WORK, CARRY, and MOVE. Boosts, combat parts, optimized ratios, body ordering, and advanced movement formulas belong in later guides.
Match each beginner part to one ability
| Body part | What it provides | First symptom when unavailable |
|---|---|---|
WORK | Harvesting, building, repairing, and Controller upgrading. | The related work action cannot run. |
CARRY | Store capacity for carrying and delivering resources. | The worker cannot retain a normal Energy load for transport. |
MOVE | Self-movement and fatigue reduction. | Movement methods cannot move the Creep under its own power. |
A body part written in the original spawn array is not automatically usable forever. The current question is how many parts remain active now.
Inspect one live Creep without changing the game
State impact: read-only. Replace Harvester1 with an exact name returned by Object.keys(Game.creeps).
const CREEP_NAME = 'Harvester1';
const creep = Game.creeps[CREEP_NAME];
if (!creep) {
console.log(
CREEP_NAME +
' was not found. Check the name and capitalization.'
);
} else {
const parts = creep.body.map(function (part, index) {
return {
index: index,
type: part.type,
hits: part.hits,
boost: part.boost || null,
active: part.hits > 0
};
});
console.log(JSON.stringify({
tick: Game.time,
name: creep.name,
spawning: creep.spawning,
activeWork: creep.getActiveBodyparts(WORK),
activeCarry: creep.getActiveBodyparts(CARRY),
activeMove: creep.getActiveBodyparts(MOVE),
storeUsed: creep.store.getUsedCapacity(),
storeCapacity: creep.store.getCapacity(),
fatigue: creep.fatigue,
parts: parts
}, null, 2));
}
This diagnostic does not submit an action or write to Memory. It compares the complete body description with the number of currently active parts.
Read the diagnostic before changing code
Use the result in this order:
- Confirm that the Creep was found and has finished spawning.
- Read
activeWork,activeCarry, andactiveMove. - Inspect
partsto see each part's type and remaining hits. - Read Store values before diagnosing harvesting or delivery.
- Read
fatiguebefore diagnosing movement. - Save the return value from the action that failed.
creep.body describes every part and its current hits. getActiveBodyparts() counts only live parts of the requested type, so a fully damaged part remains visible in the body array but no longer contributes its ability.
The Creep cannot harvest
harvest() requires an active WORK part. Begin with the action result instead of assuming that every harvesting failure means the body is wrong.
| Observation | Meaning | Next check |
|---|---|---|
activeWork === 0 | No usable WORK remains. | Check whether the part is missing or has zero hits. |
ERR_NO_BODYPART | The harvesting ability is unavailable. | Inspect active WORK. |
ERR_NOT_IN_RANGE | The ability exists, but the Source is too far away. | Move toward the Source and retry on a later tick. |
ERR_NOT_ENOUGH_RESOURCES | The selected Source has no harvestable Energy now. | Inspect the Source and its regeneration state. |
ERR_FULL | The Creep cannot accept more of the harvested resource. | Inspect free Store capacity. |
Return to the first harvesting lesson for the complete action → range check → movement pattern.
The Creep cannot carry or deliver Energy
CARRY provides the Store capacity used by the beginner worker. Diagnose the transport problem with three separate values:
activeCarry— whether usableCARRYparts remain;storeUsed— whether the Creep currently carries anything;storeCapacity— whether it has capacity for a normal transported load.
A missing or fully damaged CARRY is a body problem. A Creep that has capacity but carries zero Energy has a resource-state problem. A Creep that carries Energy but cannot transfer it may instead be out of range or facing a full or invalid target.
Use the Energy delivery lesson to inspect the Creep's load, the Spawn's free capacity, and the transfer() result.
The Creep cannot move
An active MOVE part is required for self-movement. Even when activeMove is greater than zero, the Creep may still wait because movement has other conditions.
| Observation | Meaning |
|---|---|
activeMove === 0 or ERR_NO_BODYPART | No usable self-movement ability remains. |
fatigue > 0 or ERR_TIRED | The Creep must wait for fatigue to decrease. |
ERR_NO_PATH | The movement request could not find a route to the target. |
OK but movement is intermittent | Inspect terrain, carried load, body weight, and the ratio of active MOVE parts. |
The focused moveTo() troubleshooting guide covers fatigue, spawning, paths, and repeated movement evidence in more detail.
A part can exist but no longer work
Each entry in creep.body includes its remaining hits. When a part is fully damaged, it remains in the array but stops contributing its function.
This distinction explains why checking only the original body array can be misleading:
const createdWithWork = creep.body.some(function (part) {
return part.type === WORK;
});
const activeWork = creep.getActiveBodyparts(WORK);
console.log(JSON.stringify({
createdWithWork: createdWithWork,
activeWork: activeWork
}));
The first value answers whether the body contains WORK. The second answers whether any usable WORK remains now.
Connect the three parts to the basic worker
The worker used in the previous lessons can be represented by this body array:
const body = [WORK, CARRY, MOVE];
| Part | Base cost | Role in the first round trip |
|---|---|---|
WORK | 100 Energy | Harvests from the Source. |
CARRY | 50 Energy | Stores and transports Energy. |
MOVE | 50 Energy | Moves between the Source and Spawn. |
The total is 200 Energy under the current BODYPART_COST values. This is a learning body, not a universally optimal design. The next lesson will pass this array to a real Spawn.
Completion check
You have completed this lesson when you can do all of the following:
- replace the example name with a live Creep;
- explain the difference between a listed body part and an active body part;
- match harvesting failure first to
WORKand the action result; - match carrying failure first to
CARRYand Store values; - match movement failure first to
MOVE, fatigue, and the movement result; - explain why
[WORK, CARRY, MOVE]supports the first Source-to-Spawn round trip.
Create the next Creep with spawnCreep()
You can now read a body array and diagnose why one of its abilities is unavailable. The next lesson uses that body in a real spawn request:
Create a new Creep with spawnCreep() →
Return to the English beginner roadmap to review all twelve lessons in order.