ich hab dasselbe problem ( naja.. ungefähr ) mit meiner RAIDEN Prototypen..

D:Die Rakete soll erscheinen, den nächstgelegenen gegner anvisieren ( gegner sind Ents mit Skill99 >= 5 ) und auf ihn zufliegen.
Sollte der gegner vorher draufgegangen sein.. oder während des anflugs.. soll die rakete nen andren gegner suchen...


E:The rocket should appear, fokus the nearest enemy and fly to him ( enemy have skill99 >= 5 ). If The Enemy dies meanwhile, the rocket should fokus the next enemy.



Was ich bekomme / what i get... "Empty Pointer in i_rocket"

Hier mal der raketencode / the i_rocket code :
Code:
action i_rocket()
{
	var dist;
	var dist2 = 100;
	var destroyme = 0;
	my.skill2   = 0;
	my.skill1 = reedeem2;
	
	if(reedeem2 == 1){reedeem2 = 2;}
	else{reedeem2 = 1;}
	
	ENTITY* close_ent;
	VECTOR* myTemp;
	
	set(my, PASSABLE);
	
	while(my.skill2 < 50)
	{
		if(my.skill1 == 1)
		{
			c_move(my, vector(0,-40*time_step,0), nullvector, NULL);
			my.pan += 4*time_step;
		}
		
		if(my.skill1 == 2)
		{
			c_move(my, vector(0,-40*time_step,0), nullvector, NULL);
			my.pan -= 4*time_step;
		}
		rocketeer();
		my.skill2 += 1;
		wait(1);
	}
	
	
	dist = 100000;     //maximum dist that the rocket can 'see' entities at
	while(dist2 > 30 && my.x > -1600 && my.x < 1600 && my.y > -500 && my.y < 5000)
	{
		you = ent_next(NULL); // retrieve first entity
		while(you) // repeat until there are no more entities
		{
			if(you.skill99 >= 5)
			{
				if(vec_dist(my.x,you.x) < dist)
				{
					dist = vec_dist(my.x,you.x);
					dist2 = vec_dist(my.x,you.x);
					close_ent = you;
				}
			}
			you = ent_next(you); // get next entity
			wait(1);
		}
		if(close_ent != NULL)
		{
			while(dist2 > 30 && my.x > -1600 && my.x < 1600 && my.y > -500 && my.y < 5000)
			{
				dist2 = vec_dist(my.x, close_ent.x);
				//				vec_set(temp, close_ent.x);
				vec_diff(myTemp,close_ent.x,my.x);
				vec_to_angle(my.pan,myTemp);
				my.pan += 90;
				c_move(my, vector(80*time_step,0,0), nullvector, NULL);
				rocketeer();
				my.z = 0;
				wait(1);
			}
		}
		wait(1);
	}
	//	exploding_1(my);
	wait(1);
	ent_remove(my);
}



Ich hoffe mir kann wer bei meinem fehler au helfen ^^
Hope someone is able to help me with my problem, too. ^^

Last edited by Espér; 10/02/09 14:06.

Selling my Acknex Engine Editions (A7 Com & A8 Pro):
>> click here if you are interested <<