The progress is going forward grin
I have now a code that works almost as it is supposed to. I whant a simple code to use so I can understand what I am doing..... smile....

QUESTION:
How or where in my code can I reset variabel_1 to 0 again. I have tried several places. And ended up with a if else.
So how do I write the else part so the player stops when it reaches the point I have clicked? When I use the code without the else, it goes to that point and stops. But dont react when I click again. So I must reset the varabel_1. Anyone of you have any suggestion on how to do that so it works?Then I will be gratefull!!!
And yes I can see that my code isent the best....but it works....

Code so far is this for the
mouse:
Code:
VECTOR temp;
vec_zero(temp);

function point_mouse()
{

  while(1)
  {

  temp.x = mouse_pos.x;
  temp.y = mouse_pos.y;
  temp.z = 1000;
  vec_for_screen(temp,camera);
  c_trace(camera.x,temp,IGNORE_ME);
  	if(hit.x != NULL)
  	{
  		vec_set(my.x,hit.x);
  	}
  	wait(1);
  	}
}


player:
Code:
action player_mouseAct(){
	c_setminmax(me);
	var variabel_1 = 1;

	VECTOR temp; vec_zero(temp);
	ANGLE my_angle; vec_zero(my_angle);
	while(1){
		
		if(mouse_left==1){
			variabel_1 = 0;
			vec_set(temp,mouse_pos3d.x);//mouse_pos
			vec_sub(temp,my.x);
			vec_to_angle(my_angle,temp);
			my.pan = my_angle.pan;
			vec_set(temp,mouse_pos3d.x);
			temp.z = my.z;
		}
		if(variabel_1 == 0)
		{
			if(vec_dist(my.x,temp)<=0.5) 
			{
			variabel_1 = 1;
			}
			c_move(me,vector(10*time_step,0,0),nullvector,IGNORE_ME|IGNORE_PASSABLE|GLIDE);
			
	
		}
	else
//		{
//			variabel_1 = 0;//setting the variable to null?
//		}
			
		wait(1);
	}
	
}








Last edited by Eagelina; 06/03/09 08:40.

A6 and A7 Commercial
-------------------
Programmer always searching for more to learn and understand. smile