Author Topic: Setting a bots angle  (Read 3666 times)

Offline Testlund

  • Bot God
  • *****
  • Posts: 1574
    • View Profile
Setting a bots angle
« on: December 04, 2013, 10:58:33 AM »
Why do these two work exactly the same?

 *.refxpos *.refypos angle .setaim store

 *.refxpos *.refypos angle sub .setaim store

Shouldn't the latter change the bot to opposite direction?
The internet is corrupt and controlled by criminally minded people.

Offline Testlund

  • Bot God
  • *****
  • Posts: 1574
    • View Profile
Re: Setting a bots angle
« Reply #1 on: December 04, 2013, 11:38:05 AM »
There is something not right with the .hit sysvar. The code below will make a bot turn away from a shape when it SEES it!

Code: [Select]
'Movement debugger

cond
 *.hit
 *.reftype 1 =
start
 *.refxpos *.refypos angle .setaim store
 628 .aimright store
stop
The internet is corrupt and controlled by criminally minded people.

Offline Testlund

  • Bot God
  • *****
  • Posts: 1574
    • View Profile
Re: Setting a bots angle
« Reply #2 on: December 04, 2013, 11:47:02 AM »
It's impossible to make a bot turn a half circle and swim backwards!  :banghead:
The internet is corrupt and controlled by criminally minded people.

Offline Botsareus

  • Society makes it all backwards - there is a good reason for that
  • Bot God
  • *****
  • Posts: 4483
    • View Profile
Re: Setting a bots angle
« Reply #3 on: December 07, 2013, 10:22:09 AM »
By swim backwards do you mean something like 10 .dn store?

Offline Botsareus

  • Society makes it all backwards - there is a good reason for that
  • Bot God
  • *****
  • Posts: 4483
    • View Profile
Re: Setting a bots angle
« Reply #4 on: December 07, 2013, 10:35:47 AM »
If you want the robot to turn but still move in the same direction you have to memorize the angle and use sin cos commands.

Offline Testlund

  • Bot God
  • *****
  • Posts: 1574
    • View Profile
Re: Setting a bots angle
« Reply #5 on: December 07, 2013, 12:41:41 PM »
"COS" is another thing I need to learn, but I've figured out a way for bots to handle shape. I'll upload a sim example soon. Going to check out 2.46C now.
The internet is corrupt and controlled by criminally minded people.