hi! i had another problem!
can someone tell me how to use "pXent_addexplosion" correctly?
my player can place bombs. and this bombs should be blow away a box. i give the box this action:
action ph_box() // simple physics-based box
{
pXent_settype(my, PH_RIGID, PH_BOX); // this entity behaves like a box
}
and the bomb has this function:
function bomb_behavior()
{
VECTOR bomb_pos;
while(explo_time > bomb_wait_time) //after some seconds, the bomb explode
{
explo_time -= time_step/16;
pXent_settype(my, PH_RIGID, PH_SPHERE); // this entity behaves like a ball
pXent_setfriction(my, 100);
pXent_setelasticity(my, 10);
pXent_setdamping(my, 100,40);
bomb_pos.x = my.x; //get the actually position of the bomb
bomb_pos.y = my.y;
bomb_pos.z = my.z;
... //the rest of the code (explosion anim etc.)
wait(1);
}
pXent_addexplosion( my, bomb_pos, 1000,500); //values ok???
wait(-2);
ent_remove(my);
}
i spend some hours with that addexplosion and the values but it doesn`t work.the box doesn`t move. sometimes the box disappears or flys to another dimension, not sure what happend there.