This code does not work for one reason or another; the Event is not triggering as it should.

Code:
 
function Soldier_event()
{
if (EVENT_TYPE == EVENT_CLICK)
{
beep();
}
if (EVENT_TYPE == EVENT_touch)
{
beep();
}
}

action Soldier()
{
var anim_percent = 0;
my.enable_click = on;
my.enable_touch=on;
my.event=Soldier_event;
while(1)
{
ent_animate(me, "walk", anim_percent, ANM_CYCLE);
c_move(me, vector(0.03,0,0), nullvector, IGNORE_PUSH);
anim_percent += 2.2 * Time;
wait(1);
}
}

function main()
{
//video_switch (0,0,1);
wait(1);

sky_color.red=1;
sky_color.green=1;
sky_color.blue=1;
mouse_range = 3000;
mouse_mode = 1;

level_load(RTSPlayThing1_wmb);
wait(3);



So.... why doesn't it work? You'd think the event would trigger some sort of Beep, and the Action works just fine. (Person perpetually walks towards cliff.)

I'm quite new to Events, so if someone could tell me what I am doing wrong, that would be appreciated.

btw, A6.6 commercial


If I am posting, it probably means I am asking a question. Or faking my knowledge by agreeing with somebody else.