Hello!
Iīm having a serious problem that I havenīt been able to solve, whenever I use ent_remove or ptr remove acknex.exe crashes (Windows diplays a "acknex.exe has stopped working" sign).
Any ideas on how to fix this?
Here's an example code, just in case I'm using them wrong:
///////////////////////////////
#include <acknex.h>
#include <default.c>
#include <mtlFX.c>
///////////////////////////////
ENTITY* star_ent;
function star_event()
{
switch (event_type)
{
case EVENT_ENTITY:
beep();
ent_remove(me);
wait(1);
return;
case EVENT_BLOCK:
beep();
ent_remove(me);
wait(1);
return;
}
}
action star_fall()
{
my.emask |= IGNORE_PASSABLE | ENABLE_BLOCK | ENABLE_ENTITY ;
my.event = star_event;
}
function main()
{
level_load("Test.WMB");
wait(2);
star_ent = ent_create("star.mdl",vector(0,0,300),star_fall);
phent_settype(star_ent, PH_RIGID, PH_POLY);
phent_setgroup( star_ent, 1 );
phent_setmass(star_ent,0.1,PH_BOX);
phent_setdamping (star_ent, 15, 0 );
phent_enable( star_ent, 1 );
ph_setgravity(vector(0,0,-100));
ph_selectgroup( 1 );
while(1)
{
wait(1);
}
}
The wmb file only has a block to act as the ground for collision.
Thanks in advance for your help.
----------------------------
System:
* Windows Vista Pro 64 bits
* Core 2 Duo 2.13 Ghz Processor
* 5 Gb RAM
* nvidia 8800GTS video card
----------------------------