Please take a look at this code.

My problem is that I can't combine EVENT_IMPACT and EVENT_DETECT at the same time. When I test it EVENT_IMPACT won't work if EVENT_DETECT is activated.

EVENT_IMPACT is working if I remove EVENT_DETECT.

How can I make the two work together.

function viol_func()
{
my.event = NULL;
if (event_type == EVENT_IMPACT)
{
set(viol_damageproperty,VISIBLE);
viol_cntr += 1;
wait(-3);
reset(viol_damageproperty,VISIBLE);

viol_trigger = 0;

count_damageprop += 1;

if(tutorial_mode == 1)
{
tutorial_failure_event();
}

}


my.event = viol_func;
}

function carinit_event()
{
my.event = NULL;
if(event_type == EVENT_DETECT)
{
you.skill12 = 0;
wait(-5);
you.skill12 = aispeed;
}

my.event = carinit_event;
}

action FollowPath_3()
{
var temp2 = 0;
my.emask |= ENABLE_IMPACT | ENABLE_DETECT;
my.event = viol_func;
my.event = carinit_event;
my.skill11 = 0;
my.skill12 = aispeed;
while(1);
{

blah blah blah

c_move(me,vector(my.skill12*time_smooth,0,0),nullvector,GLIDE | IGNORE_PASSABLE | IGNORE_FLAG2 | ACTIVATE_TRIGGER);

c_scan(my.x,my.pan,vector(200,200,500),SCAN_ENTS);

blah blah blah

wait(1);
}

}

Last edited by jpxtreme; 02/24/11 06:17.