Hello, guys

***PROBLEM SOLVED***

I typed in some code to narrate a part of my game story. I used a function called play_movie2(). The function creates a view ,sets it position and orientation according to another character model "robert" which stands in front of the player (I teleported the player using her x ,y and z components 'cause I wanted her to stand in a certain place).


Anyway, when the function is executed ,an "invalid arguments E1515" appears at me. I can't figure out where is the faulty argument and I can't find any pointer returning NULL undesirably. Here is the fucntion (the player pointer is named "player1"):



Code:
VIEW* movie_camera3;


function play_movie2()
{
	var time_passed = 0;
	var distance_to_ground;
	
	VECTOR g_temp;
	VECTOR temp;
	VECTOR temp2;
	
	
	snd_tune(snd_forest_handle,50,0,0);
	
	//initialize the camera for Mr. Rubert and Miss Clara Lear
	movie_camera3 = view_create(6);
	wait(2);
	movie_camera3.pos_x = 0;
	movie_camera3.pos_y = 0;
	movie_camera3.size_x = screen_size.x;
	movie_camera3.size_y = screen_size.y;
	
	wait(1);
	movie_camera3.x = 5841;
	movie_camera3.y = 11442;
	movie_camera3.z = 455;
	
	movie_camera3.tilt = 0;
	movie_camera3.pan = 0;
	movie_camera3.genius = NULL;
	movie_camera3.flags |= AUDIBLE;
	//ACTION!!...
	p_able_to_move = 0;
	toggle(camera,SHOW);
	set(movie_camera3,SHOW);
	
	player1.x = 5798;
	player1.y = 11696;
	
	robert = ent_create("Robert.mdl",vector(5666,11629,510),NULL);
   vec_set(temp.x,robert.x);
   vec_sub(temp.x,player1.x);
   vec_to_angle(player1.pan,temp.x);
	
	while(time_passed < 5 )
	{
	time_passed += time_step/16;
	
	vec_set(temp.x,robert.x);
	vec_sub(temp.x,movie_camera3.x);
	vec_to_angle(movie_camera3.pan,temp.x);
	
	vec_set(temp2.x,player1.x);
	vec_sub(temp2.x,robert.x);
	vec_to_angle(robert.pan,temp2.x);
	
	vec_set(g_temp.x,robert.x);
   g_temp.z -= 5000;
   distance_to_ground = c_trace(robert.x,g_temp.x,IGNORE_ME | USE_BOX) - 17;
      
   c_move(my,nullvector,vector(0,0,-distance_to_ground),GLIDE | IGNORE_PASSABLE);
      
   
	ent_animate(robert,"stand",robert.stand_percentage,ANM_CYCLE);
	robert.stand_percentage += 2*time_step;
	
	ent_animate(player1,"stand",player1.stand_percentage,ANM_CYCLE);
	player1.stand_percentage += 3*time_step;
	
	wait(1);
   }
}




Thank you for reading

Last edited by The_KING; 07/15/13 12:28.