Bots and Simulations > DNA - General

[Request] Body Limiter Code

(1/1)

spike43884:
I really would love someone to make me a special body gene, I want to keep the bot to have Y body for every X nrg it has...to keep the body and nrg relative...
Its because im making a gender-based multibot.

Shadowgod2:
really? i do that quite often. really easy.

cond
start
*.body *.nrg sub 0 floor .fdbody store
*.nrg *.body sub 0 floor .strbody store
stop

this will make the body and nrg =

cond
start
*.body *.nrg 1 sub sub 0 floor .fdbody store
*.nrg 1 sub *.body  sub 0 floor .strbody store
stop

this will make nrg 1 less than body. just modify 1 for your distance away from the other.

cond
start
*.body *.nrg 2 div sub 0 floor .fdbody store
*.nrg 2 div *.body sub 0 floor .strbody store
stop

this will make nrg half of body. just modify 2 for the difference.

move the modifier from the nrg to the body for the opposite effect. move the modifier don't change the nrg to body or body to nrg or you will have a big problem. it will either grow to death or shrink to death.

there you have it, very simple.

spike43884:
So -2 will make nrg double of body right? As 2 made nrg half of body.

Shadowgod2:
no if you want that change div to mult or do as i said above and move 2 div from nrg to body.

spike43884:

--- Quote from: Shadowgod2 on February 23, 2015, 05:03:01 PM ---no if you want that change div to mult or do as i said above and move 2 div from nrg to body.

--- End quote ---
OK

Navigation

[0] Message Index

Go to full version