My code is refusing to work so it is simple enough, I just cant get it, it is supposed to read that an object hit it (perferable a bullet but I can just use my character for impact right now for testing purposes) and when it hits the light the light falls and kills anyone below it. Damage code is not inputed, I'm getting a critical error when I try to run the code though.
Code:
function light_fall
{
if (event_type == event_impact)
{
temp.z -= 4000; //calculate a spot 4000 quats below entity (playing with this value)
trace_mode = ignore_me+ignore_sprites+ignore_models+use_box; //calculate box around player for collision, only detects level geometry and
entities
dist.z = -trace(my.z,temp);
sleep (5); // let me get out of the way
while (dist.z > 0)
{
dist.z = -trace(my.z,temp);
my.z -= 3; // move the light
wait (1);
}
}
}
action light
{
my.push = 20; //push must have higher value on light then object hit to trigger
my.enable_impact = on;
you.push = 15;
my.event = light_fall;
}
EDIT: So how about this then, I still get a crititical error set off my microsoft and I still think it is because of this code, please help.