proc Get_Dist(atom/A, atom/B) return sqrt( ( A.x - B.x )**2 + ( A.y - B.y )**2 ) Get_Beacon(var/number) for(var/obj/AI_beacon/BEACON as obj in world) if( BEACON.number == number ) return BEACON AI_Loop() if( Get_Dist( src, Get_Beacon( src.beacon ) ) <= 4 ) var/obj/AI_beacon/next_beacon = Get_Beacon( src.beacon+1 ) src.wanted_angle = arcsin( ( next_beacon.y - src.y ) / Get_Dist( src, next_beacon ) )
It successfully gets through the first four points, but after that the car keeps running into the right wall.
[edit] I'm not positive that this is what it does, but it should go at an angle of (approxiamately) 135 degrees (northwest) but instead it goes at an angle of (exactly) 45 degrees (northeast). Essentially, I made the AI car the origin, and found what quadrant the next beacon would lie in, but that doesnt seem to work either. I tried arctan() but that did the same thing.
[link]
If that doesn't work, you'll have to wait until someone with more math skill logs on.
~X