Hi again,

I want to use grenades in my game that sticks at objects.
It's like the "Plasma Grenade" in Halo 1- 3?

Who don't know the game:
In the game is a kind of grenade that sticks at modells.
Here you can see it in action:
plasma grenade sample video
and here is something to read:
Plasma grenade text



Ok I think you know what I want.

I tried it by using the PhysX-Engine to throw the grenate.
Here is my hopeless try for the grenade.

Code:
action pl_grenade_act()
	{
		set(my,CAST|SHADOW|PASSABLE);
		my.emask|=ENABLE_SHOOT|ENABLE_BLOCK|ENABLE_IMPACT|ENABLE_ENTITY|ENABLE_FRICTION;
		my.push=50;		

		my.waittime=40;
		pXent_settype(me,PH_RIGID,PH_SPHERE);	
		pXent_setmass (my, 10); 
		pXent_setfriction (my, 80);
		pXent_setdamping (my, 10, 10); 
		pXent_setelasticity (my, 50); 
		my.lightrange=70;
		my.red=0;
		my.blue=100;
		my.green=20;
		
		pXent_settype(me, PH_RIGID, PH_SPHERE);
		
		wait(1);
		
		
		while(1)
		{	
                        //get sticky now:

			c_trace (my.x,you.x,IGNORE_ME|IGNORE_PASSABLE|SCAN_TEXTURE);	
			if(you&&my.waittime<=36)
			{		
			   pXent_settype(me,NULL,NULL);	
			   VECTOR hit_vec;		
			   CONTACT* contact1 =ent_getvertex(you,NULL,hit.vertex);
			   vec_for_ent (contact1.x, my);
			   vec_for_vertex (hit_vec,you,hit.vertex);
                           my.x=hit_vec.x;		
			}

                //handle time counter and explosion


                ...

			wait(1);
		}
	}




My problem is to handle that the grenade find the next vertex to stick on it.

I've read something about. hit.vertex but cant handle to use it.

I think its an hard way to get it working with the c_trace event.
My next try was to use the physX engine to get sure that the grenade collides with another PhysX-modell.


I used something like that:

Code:
pXent_setcollisionflag(me,enemy,NX_NOTIFY_ON_START_TOUCH); 
my.event=get_sticky;



But it doesn't work. frown



Any Ideas?
BTW I am using 3D Gamestudio A8-Commercial for that.


regards sebbi


3D-Gamestudio A8 - Commercial