.fixpos
Anchors the bot in place while it is greater than 0; with 0 or a negative it releases it.
Facts
- Address
- 216
- Name
.fixpos- Kind
- Command: the bot writes it and the engine reads it and usually consumes it
- Group
- Movement
- Written by
- Your DNA. If the species was loaded marked as anchored, the bot is born with 1.
- Read by
- The engine, in the forces and collisions phase of every cycle, unless the simulation has anchoring turned off.
- Cleared
- Never: what you wrote stays until you change it.
- Range
- −32000 to 32000; more than 0 anchors the bot, 0 or less releases it.
- Mutations
- picked as a store target
.fixpos is a switch: with a value greater than 0 the bot is anchored, with 0 or a negative it is free. Unlike the movement commands, the engine never clears it: what you write stays until you change it, so writing it once is enough. The effective state is read in .fixed.
An anchored bot receives no force at all: neither its own pushes with .up (which do not cost it energy either) nor gravity. In a collision its velocity does not change and it counts as a very heavy body, although the engine may still nudge it a little to separate the two bots if they overlap. It can still turn with .aimsx, .aimdx or .setaim, and see or shoot normally.
The simulation can have anchoring disabled; in that case .fixpos does nothing. Some species start with .fixpos at 1 because whoever loaded them into the simulation marked them that way.
' stays still from 100 cycles of age on
cond
*.robage 100 >
start
1 .fixpos store
stopTo release it again, 0 .fixpos store is enough.