
Creep cannot move, if it was spawned without MOVE body parts, or if its all MOVE body parts were destroyed by enemy.
Creeps must have at least one active MOVE body part to be able to move. You cannot control creeps of other players. Creep cannot walk into a wall, a structure (unless this is its own ramparts or a container), or into another creep (unless the other creep moves to another tile during the same tick). A creep having fatigue will not move until its fatigue reaches 0. However, there are restrictions that might limit the creeps to be able to do so: A creep can therefore do both in 1 tick.ĪI can order a creep to move. Important to note is that rangedAttack is separate from attack and heal. heal or repair or build or attack or harvest. Not all actions can be executed, for example a creep can't heal and attack in 1 tick. These will then be executed in a fixed order. If a part takes 100 points of damage, it will be completely disabled - the creep may no longer use that part's ability.Ĭreeps will get several actions scheduled to execute per tick. It is important to note that the order in which parts are added to a creep is important! The sequence of parts dictate which components will be damaged first when a creep is attacked. This provides a cheap way to add hit points to a creep. No effect other than the 100 hit points all body parts add. Restores 12 hit points/tick at short range (1 tile) or 4 hits/tick at a distance (up to 3 tiles). Short-ranged attack (1 tile).Īttacks a target creep/structure. Weighs nothing when empty.Īttacks a target creep/structure. Consumes 0.01 energy/hit repaired, rounded up to the nearest whole number.
Builds the designated structure at a construction site, at 5 points/tick, consuming 1 energy/point. Gathers 2 energy/tick.Ĭonstructs a target structure. Each part has weight, which increases creep fatigue as it traverses terrain tiles, with the exception of the MOVE module the more parts a creep bears, the more difficult it is for it to move. These components each provide the creeps with 100 hit points and a corresponding ability.
If (mycreep.Creeps are composed of a sequence of one to fifty of the seven different body parts. if creep has no energy, go to the energy source and harvest some if our creep doesn't exist, create it from our spawn The code inside of these curly brackets will run once per tick. If you're new to programming, or you're new to JavaScript, but you think Screeps is cool and you really want to play it, in this tutorial I'm going to show you the simplest Screeps code possible and I'm going to walk you through step-by-step what each line of code means, what it does, and how I got there.