Bots and Simulations > DNA - General

Aiming/moving problems

(1/2) > >>

Testlund:
EDIT: Blah-blah-rant...


--- Code: ---The correct code is posted below!

                ||
                ||
                ||
              \\||//
               \\//
                           

--- End code ---

Testlund:
It doesn't execute the code in the correct order! I want the bot to set the angle, then turn around and THEN move!

cond
 *.eyef 0 >
start
  *.refxpos *.refypos angle .setaim store
 628 .aimdx store
 64 .up store
stop

It doesn't matter which order I place the code. The bot always moves forward before it turns!  :blueblob:

Shadowgod2:
Use a trigger

cond
*50 1 =
start
...
stop

cond
*.eyef 0 >
start
628 .turnsx store
1 50 store
stop

Something like that

Testlund:
What is the number 50 here supposed to do. You mean .aimsx, not .turnsx, right? If I use this the bot will just turn, not move away:

cond
*.eyef 0 >
start
628 .aimsx store
1 50 store
stop

But I found if I use .dn instead the bot will get away better.

cond
 *.eyef 0 >
start
 64 .dn store
 *.refxpos *.refypos .setaim store
 628 .aimdx store
stop


Peter:

--- Quote from: Testlund on September 15, 2014, 03:38:16 PM ---It doesn't execute the code in the correct order! I want the bot to set the angle, then turn around and THEN move!

cond
 *.eyef 0 >
start
  *.refxpos *.refypos angle .setaim store
 628 .aimdx store
 64 .up store
stop

It doesn't matter which order I place the code. The bot always moves forward before it turns!  :blueblob:

--- End quote ---
The order of the code doesn't matter. There's a solid order of actions, I don't know where it was described, but it's somewhere on the forom, I think EricL wrote it down. Apparently moving goes before turning, so you need to turn and then you can move forward the next cycle.

Moving backwards works even better. :P

Navigation

[0] Message Index

[#] Next page

Go to full version