Ok,
Basic problem: I have a street and want my cars to follow it on the right lane. This already works well but if they come to a curve I can't get to controle them. Here a screen of how they move:


I use the A* Pathfinding. So each little bit of street is a own "pattern" the green dots are the centers. And the red arrows are the movement of the car. Here is a part of my code I've already written so the cars drive onto the left or right lane:
Code:
vec_add(spur_ziel_vec,vector(0,-cell_size[1]/3,0));	
vec_rotate(spur_ziel_vec,my.pan);
				//Schaue in Richtung nächster Wegpunkt
				vec_set(temp_vec,vector(path_point_x(my.skill1,temp2)+spur_ziel_vec[0],path_point_y(my.skill1,temp2)+spur_ziel_vec[1],my.z));	
				vec_sub(temp_vec,my.x);
				vec_to_angle(my.pan,temp_vec);
				vec_fill(temp_vec,0);//"Nulle" den Vektor

				
				

				
				// Solange bewegen bis es am Ziel ist
				while(vec_dist(my.x,vector(path_point_x(my.skill1,temp2)+spur_ziel_vec[0],path_point_y(my.skill1,temp2)+spur_ziel_vec[1],my.z))>5)
				{
					//Schaue in Richtung nächster Wegpunkt
					vec_set(temp,vector(my.x+car_speed*time_step,my.y,my.z));
					vec_sub(temp,my.x);
					vec_rotate(temp,vector(my.pan,0,0));
					vec_add(my.x,temp);
					vec_fill(temp,0);
					
					wait(1);
				}


As you may guess the cell_size is the size of the single patterns.
So everytime it reaches a waypoint it looks into the direction of the next waypoint, calculated on which lane it has to drive and start moving. I tryed diffrent things with the curves but can't get anything to work. Any suggestions?

The second problem is that the car drives into the center of the next streight street-part after a curve. Like seen on the screen.


Also btw: Does anyone else got some problems with c_trace in last time? I can't get it to work anymore. It doesn't seem to find entitys anymore even if I exactly know the position of it and trace to it.

P.S.: Sorry for my bad english laugh

Last edited by Nicotin; 07/04/09 15:55.