Bots and Simulations > Bot Tavern

How do you make a bot stop moving?

<< < (3/6) > >>

Peter:
cond
*.velup 0 !=
*.veldn 0 !=
start
  *.velup - .up store
  *.veldx - .dx store
stop

I think this is the most simple solution.

Testlund:
No, it doesn't work.

Panda:
Is the aim of the bot to move away from a bot that is shooting it...
if so then you could


--- Code: ---cond
  *.shflav -1 =
  *.shflav -6 = or
start
  *.refvelup 30 add .up store
  *.refveldx 30 add .dx store
stop

cond
  *.shflav 0 =
start
  *.velup - .up store
  *.veldx - .dx store
stop
--- End code ---

Im hoping that'll work.

Peter:
I tested the genes, and they work. Both they have a short impulse speed for one cycle then stop.

Could you post the bot you're working on.
If your problem is slight random movement every cycle, brownion movement is causing that. You could deactivate that in the physics tab.

Also if your goal is just to stop the bot moving the next cycle you can use toggle zero momentum with the (advanced)physics options.


Gene testing code.

--- Code: ---cond
*.velup 0 !=
*.veldn 0 !=
start
*.velup - .up store
*.veldx - .dx store
stop

cond
  *.robage 10 =
start
*.maxvel .up store
stop
--- End code ---

and


--- Code: ---cond
*.fixed 0 !=
start
0 .fixpos store
stop


cond
*.velup 0 !=
*.veldn 0 !=
start
.fixpos inc
stop

cond
  *.robage 10 =
start
*.maxvel .up store
stop
--- End code ---

Panda:
I have ammended the code


--- Code: ---cond
  *.shflav -1 =
  *.shflav -6 = or
start
  *.maxvel .up store
  *.maxvel .dx store
stop

cond
  *.shflav 0 =
start
  *.velup - .up store
  *.veldx - .dx store
stop
--- End code ---

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version