I'm letting you know I found a lot of stupid mistakes I checked alot of things and everything seems to work until I hit trace, I think that is where I messed up here it is. Code:
 var light_impact = 1;	//makes sure impact only is triggered once
var lightvec[3];
var light_target;

function light_fall_func
{
sleep (1); // let me get out of the way
// this also returns to the event function so it can terminate.
trace_mode = ignore_me+ignore_you+ignore_sprites+ignore_models+ignore_passable+use_box;
//calculate box around light for collision,
// should only detect level geometry
light_target = trace(my.z,lightvec); //I think it detects something besides geometry
if (target < 50)
{
msg_show ("less than 50", 5); //testing purposes
}
while (my.z > target) //when there is still distance between the target
{
msg_show ("Now I'm in the trace loop", 5); //testing purposes
trace_mode = ignore_me+ignore_you+ignore_sprites+ignore_models+ignore_passable+use_box;
//can't be sure it is the same after a wait
my.z -= 1; // move the light
wait (1);
}
}

function light_fall
{
if (light_impact == 1)
{
light_impact = 0; //stop trigger, only happens once
wait(1); //let everything settle for a frame
you.push = 0; //value is already at 0, put in for good measure
vec_set(lightvec,my.z);
lightvec.z -= 100; //calculate a spot 100 quats below entity
// (playing with this value)
light_fall_func(); // start the real function now
}
}

action light
{
my.push = 1; //push must have higher value on light
// then object hit to trigger
my.enable_impact = on;
my.event = light_fall;
}



Last edited by Trooper119; 03/15/06 03:38.

A clever person solves a problem.
A wise person avoids it.
--Einstein

Currently Codeing: Free Lite-C