.tie
Order to tie yourself to the bot you are looking at; the number you write is the tie port you will use to name that tie.
Facts
- Address
- 330
- Name
.tie- Kind
- Command: the bot writes it and the engine reads it and usually consumes it
- Group
- Ties
- Written by
- Your DNA.
- Read by
- The engine, in the actions phase of the same cycle: if a bot is within reach, it tries to tie you to it and the number becomes the tie port. It charges energy whether it succeeds or not (parameter Tie).
- Cleared
- The engine, whenever it was not 0, whether or not the tie forms.
- Range
- −32000 to 32000; 0 is not a command
- Mutations
- picked as a store target
Write a number other than 0 and at the end of the cycle the engine tries to tie you to the bot you are looking at, the same one described by the ref* cells such as .refeye. If you don't see anyone, in the first two cycles of life it uses the parent, and otherwise, the last bot that touched you. It has to be a bot (not an obstacle) and be close: about 400 edge to edge at most. The order is always cleared, whether it works or not.
The number is the tie port: the name you will use later to pick that tie in .tienum, .deltie or .readtie, and it ends up in your .tiepres. The other bot doesn't see your number: for it the tie is named by its order number (1 if it is the first one it has).
What you need to know:
- Each attempt with someone in range costs energy (the simulation's tie cost, divided by the number of ties you already have plus one), whether it works or not.
- If the other bot has slime (
.slime), the tie can fail; with more than 92 it always fails. Each attempt takes 20 slime from it. - Tying the same bot twice replaces the previous tie. That is why a child that ties itself to its parent overwrites the birth tie.
- After 19 cycles the tie stiffens and both bots become multicellular (
.multi). - A bot has at most 9 ties. A tie breaks on its own if the bots move apart more than 1000 edge to edge.
' newborn: tie to the parent with tie port 7
cond
*.robage 1 =
start
7 .tie store
stop