Quote:

@Leaf:
Well you wanted some help with the IF statement, so I wrote it
Basicly it checks if the my entity was clipped in the last frame, which means that it is potentially invisible (if clipped = on), so I check if clipped is off or not on (!= on).
Then I check if the distance of the my entity to the camera is below or equal a certain value.
Just enter a value for "many_quants"

@xXxGuitar: No problem mate

EDIT:
An quick example Code:

action my_bounding_box_char
{
wait(1);
c_updatehull(my,my.frame);
wait(2);

while(me)
{
if(my.clipped != on && vec_dist(my.x,camera.x <= 500)
{
beep;
}
wait(1);
}
}


That code should bring some noise into your level (due to the "beep;")




Thanks man I got it figured Needed to move some brackets around and shorten the action name. Got "action not found" error because the name was too long Also, added a wait to the action so it doesn't beep out of control and lag to hell. Heres what ive changed it too.

Perfect script man I can now use it to make triggers to open doors easier Well here it is working script for it:

ACTION bounding_box {

my.shadow = on;
my.gravity = 1;
my.entity_type = 2;
my.enable_scan = on;
wait(1);
my.enable_impact = on;
my.polygon= on;
c_updatehull(my,my.frame);
wait(2);

while(1)
{
if(my.clipped != on && vec_dist(my.x,camera.x) <= 500)
{
wait(100);
beep;
}
wait(1);
}
}




Your if statement was:
if(my.clipped != on && vec_dist(my.x,camera.x <= 500)

Mine changed to work:
if(my.clipped != on && vec_dist(my.x,camera.x) <= 500)

Just a mixup of brackets

Last edited by Leaf; 06/08/07 07:20.