Author Topic: How do you make a bot stop moving?  (Read 8049 times)

Offline Testlund

  • Bot God
  • *****
  • Posts: 1574
    • View Profile
How do you make a bot stop moving?
« on: December 18, 2009, 12:16:54 PM »
I couldn't find any explanation on the wiki how to stop a bot once it has started moving, to prevent it from keep moving forever.
The internet is corrupt and controlled by criminally minded people.

Offline Moonfisher

  • Bot Overlord
  • ****
  • Posts: 592
    • View Profile
How do you make a bot stop moving?
« Reply #1 on: December 18, 2009, 12:49:57 PM »
I don't think I understand the question... you mean like .fixpos or fluid resistance ?

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
How do you make a bot stop moving?
« Reply #2 on: December 18, 2009, 12:59:38 PM »
You can check against *.velup, etc. and feed the negative of that value in to .up, etc.

See Sysvar list if you haven't yet.  There's good references there for different sysvars you can use.
« Last Edit: December 18, 2009, 01:00:54 PM by Numsgil »

Offline Testlund

  • Bot God
  • *****
  • Posts: 1574
    • View Profile
How do you make a bot stop moving?
« Reply #3 on: December 18, 2009, 02:10:00 PM »
I've been looking through the sysvar lists and bot tutorials the whole evening. I understand what they mean but not how they are supposed to be combined. I tried this, but it has no effect on stopping the bot:

cond
*.shflav -1 =
start
25 .up store
stop
cond
*.myup 25 =
start
-25 .up store
stop
cond
*.shflav -6 =
start
25 .dn store
stop
cond
*.mydn 25 =
start
-25 .dn store
stop
The internet is corrupt and controlled by criminally minded people.

Offline Moonfisher

  • Bot Overlord
  • ****
  • Posts: 592
    • View Profile
How do you make a bot stop moving?
« Reply #4 on: December 18, 2009, 02:16:51 PM »
mydn is not you movement speed, it's the amount of .dn commands in the dna...
.veldn is your speed... and if you set .up to -25 you'll be moving backwards...
« Last Edit: December 18, 2009, 02:17:41 PM by Moonfisher »

Offline Panda

  • Global Moderator
  • Bot Destroyer
  • *****
  • Posts: 476
  • Computer Science Undergraduate (nerd)
    • View Profile
How do you make a bot stop moving?
« Reply #5 on: December 18, 2009, 02:20:49 PM »
do you want it to start moving again afterwards or just stop altogether

Offline Testlund

  • Bot God
  • *****
  • Posts: 1574
    • View Profile
How do you make a bot stop moving?
« Reply #6 on: December 18, 2009, 02:35:41 PM »
I just want it to move away a bit whenever it gets shot.
The internet is corrupt and controlled by criminally minded people.

Offline Panda

  • Global Moderator
  • Bot Destroyer
  • *****
  • Posts: 476
  • Computer Science Undergraduate (nerd)
    • View Profile
How do you make a bot stop moving?
« Reply #7 on: December 18, 2009, 02:41:24 PM »
Whenever you want it to stop, try
Code: [Select]
  *.velup - .up store
  *.veldx - .dx store

Offline Testlund

  • Bot God
  • *****
  • Posts: 1574
    • View Profile
How do you make a bot stop moving?
« Reply #8 on: December 18, 2009, 02:57:23 PM »
I'm trying all sorts of combinations but nothing works. Sorry, but I don't see any logic at all in bot programming. Maybe you can tell me how I put it together?  
The internet is corrupt and controlled by criminally minded people.

Offline Peter

  • Bot God
  • *****
  • Posts: 1177
    • View Profile
How do you make a bot stop moving?
« Reply #9 on: December 18, 2009, 03:14:10 PM »
I think this works

//resetter put this before the other gene!
cond
*.fixed 0 !=
start
0 .fixpos store
stop


cond
(when bot should stop)
start
.fixpos inc
stop
Oh my god, who the hell cares.

Offline Peter

  • Bot God
  • *****
  • Posts: 1177
    • View Profile
How do you make a bot stop moving?
« Reply #10 on: December 18, 2009, 03:27:25 PM »
cond
*.velup 0 !=
*.veldn 0 !=
start
  *.velup - .up store
  *.veldx - .dx store
stop

I think this is the most simple solution.
Oh my god, who the hell cares.

Offline Testlund

  • Bot God
  • *****
  • Posts: 1574
    • View Profile
How do you make a bot stop moving?
« Reply #11 on: December 18, 2009, 03:45:39 PM »
No, it doesn't work.
The internet is corrupt and controlled by criminally minded people.

Offline Panda

  • Global Moderator
  • Bot Destroyer
  • *****
  • Posts: 476
  • Computer Science Undergraduate (nerd)
    • View Profile
How do you make a bot stop moving?
« Reply #12 on: December 18, 2009, 04:04:50 PM »
Is the aim of the bot to move away from a bot that is shooting it...
if so then you could

Code: [Select]
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

Im hoping that'll work.
« Last Edit: December 18, 2009, 04:23:33 PM by Panda »

Offline Peter

  • Bot God
  • *****
  • Posts: 1177
    • View Profile
How do you make a bot stop moving?
« Reply #13 on: December 18, 2009, 04:19:51 PM »
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: [Select]
cond
*.velup 0 !=
*.veldn 0 !=
start
*.velup - .up store
*.veldx - .dx store
stop

cond
  *.robage 10 =
start
*.maxvel .up store
stop

and

Code: [Select]
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
Oh my god, who the hell cares.

Offline Panda

  • Global Moderator
  • Bot Destroyer
  • *****
  • Posts: 476
  • Computer Science Undergraduate (nerd)
    • View Profile
How do you make a bot stop moving?
« Reply #14 on: December 18, 2009, 04:31:24 PM »
I have ammended the code

Code: [Select]
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
« Last Edit: December 18, 2009, 04:31:46 PM by Panda »