Start with car_Ai from AUM 33 and on. It is what I modified to write a old race track ai. If you need more help with specific instructions PM me or ask here.


Take a look at this poor code I've used
Code:
action car(){
wait(random(3)); // Randomize first selection AI_ENT
	track_select=1; // GLOBlE NOTICE
	if(track_select >1)
	track_select = 1;
	if(track_select ==1)
	path_set(my,"path_000");
	if(track_select ==2)
	path_set(my,"path_001");
	if(track_select ==3)
	path_set(my,"path_002");
	if(track_select ==4)
	path_set(my,"path_003");
	if(track_select ==5)
	path_set(my,"path_004");
	if(track_select ==6)
	path_set(my,"path_005");
	if(track_select ==7)
	path_set(my,"path_006");
	if(track_select ==8)
	path_set(my,"path_007");
	if(track_select ==9)
	path_set(my,"path_008");
	/////////////////////////////////////////////////////////////////////
	
	my.NODE_NEXT=path_nextnode(my,1,1); // SET THE NODE
	while(1)
	{
         // PATH NODE DETECTION AND RANDOMIZATION AND FACING //////////////////////////////////
		
		
		if(vec_dist(my.x,vec_next_node.x) < my.max_x)    // Is next node within 160 units 
		{
			path_next(my); // will jump from current path to new path// Jump to new path
			my.NODE_NEXT=path_nextnode(my,my.NODE_NEXT,1); // Grab Next node on new path -- NOTE ALL PATHS MUST HAVE THE SAME NUM NODE IN SAME GEN LOCATION
			my.skill10=0; // only enable facing the path node if changing the path.   
		}
		
		path_getnode(my,my.NODE_NEXT,vec_next_node,NULL);  // Get next node actual vector location 
		
		if(my.skill10 ==0)
		{
			vec_to_angle(my.pan,vec_diff(NULL,vec_next_node,my.x)); // face the new node
		}

		///////////////////////////////////////////////////////////////////////////
		
		// SOFT AND HARD MOVEMENTs /////////////////////////////////////////////////////////////
		
		c_move(my,vector(my.skill3*time_step,0,0),nullvector,GLIDE | IGNORE_PASSABLE);
		
wait(1);
}
}


Last edited by Malice; 05/11/15 14:06.