Hey,

I just wrote this script, the events worked (from BLOCK,ENTITY and IMPACT) but now if my object is flying against an object nothing happens?
Code:
BMAP* ant = "antrieb.png";
SOUND* fly = "migloop.wav";
var energy;
function crash()
{
	level_load(level_name);
}
function weg_2(PARTICLE *p)
{
	p.alpha -= 45*time_step;
	if(p.alpha < 0)
	p.lifespan = 0;
}
function antrieb(PARTICLE *p)
{
	p.bmap = ant;
	p.size = 75;
	p.vel_x = 10;
	p.alpha = 100;
	p.flags |= (BRIGHT | TRANSLUCENT);
	p.event = weg_2;
}
function laser_weg()
{
	ent_remove(me);
}
function laser_func()
{
	my.emask |= (ENABLE_BLOCK | ENABLE_ENTITY | ENABLE_IMPACT);
	my.event = laser_weg;
	my.pan = camera.pan;
	my.tilt = camera.tilt;
	while(me)
	{
		c_move(me,vector(50,0,0), nullvector,USE_POLYGON);
		wait(1);
	}
}
action spacefighter_act()
{
	ent_playloop(my,fly,750);
	my.material = mat_metal;
	energy_pan.flags |= (SHOW);
	my.emask |= (ENABLE_BLOCK | ENABLE_ENTITY | ENABLE_IMPACT);
	my.event = crash;
	var speed = 10;
	VECTOR temp;
	VECTOR temp2;
	VECTOR temp3;
	VECTOR shot1;
	VECTOR shot2;
	var shot_diff = 0;
	while(me)
	{
		vec_for_vertex(temp2,me,16);
		vec_for_vertex(temp3,me,208);
		vec_for_vertex(shot1,me,106);
		vec_for_vertex(shot2,me,132);
		effect(antrieb,1,temp3,NULL);
		energy_pan.angle = energy - 100;
		if(energy < 100){energy += 1*time_step;
		}
		c_rotate(me,vector(0,(key_w - key_s) *speed* time_step,(key_a  - key_d) *speed* time_step),USE_AXISR);
		if(mouse_left == 1)
		{
			vec_add(shot1,vector(speed + 10,0,0));
			vec_add(shot2,vector(speed + 10,0,0));
			if(shot_diff == 1)
			{
				ent_create("shot.mdl",shot1,laser_func);
				shot_diff = 0;		
			}
			if(shot_diff == 0)
			{
				ent_create("shot.mdl",shot2,laser_func);
				shot_diff = 1;
			}
		}
		if(key_shiftl == 1 && energy > 0)
		{
			energy -= 5*time_step;
			speed = 20;
		}
		else
		{
			speed = 10;
		}
		c_move(me,vector(speed,0,0), nullvector, USE_POLYGON);
		VECTOR offset;
		vec_set(offset,vector(-700,0,150));
		vec_rotate(offset,my.pan);
		vec_set(camera.x,my.x);
		vec_add(camera.x,offset);
		vec_set(camera.pan,my.pan);
		wait(1);
	}
}



Strange, isn't it?

Last edited by TheLiam; 09/25/10 15:21.

"Ich weiss nicht genau, was Sie vorhaben, aber Sie können keine Triggerzonen durch Ihr Level kullern lassen."
-JCL, 2011