.fdbody
Converts body into energy: up to 100 energy per cycle, at 10 energy per body point.
Facts
- Address
- 312
- Name
.fdbody- Kind
- Command: the bot writes it and the engine reads it and usually consumes it
- Group
- Body, energy and state
- Written by
- Your DNA.
- Read by
- The engine, in the actions phase of the same cycle: takes that energy out of the body, at 10 energy per point.
- Cleared
- The engine, after using it. A negative value is also cleared, with no effect.
- Range
- −32000 to 32000; only 1 to 100 count (more than 100 counts as 100).
- Mutations
- picked as a store target
Write how much energy you want to take out of the body and the engine converts it in the same cycle: 100 .fdbody store adds 100 to .nrg and subtracts 10 from .body. It is the inverse operation of .strbody, and it has no extra cost.
Some details:
- Cap of 100 per cycle. A larger value counts as 100. To take out more, write again in the following cycles.
- Cleared when used. After the conversion it goes back to 0, so you have to write it in every cycle in which you want it.
- Negatives do nothing: the engine clears them without converting. (In the original DarwinBots they stayed written in the cell; the port fixed that.)
- It does not check how much body you have left. If the body falls below 0.5, the bot dies. It is a good idea to put a condition on
*.body. - Energy does not go above 32000. If you are already near the cap, the excess is lost, and the body is deducted anyway.
' If it runs out of energy, it eats from its body
cond
*.nrg 1000 <
*.body 50 >
start
100 .fdbody store
stopThe typical use, together with .strbody, is covered in Body, energy and state.