Hi there,
Again, Its late, and Im not sure if this gonna help you but is it a collision that causes the enemies death?
If yes, you could use an event to use the "you" pointer.

In the momemt, where a enemy dies trough a collision, the "you" pointer is set
to that enemies id. That means you can directly access the enemy's attribut with an event.

Code:

define ent_id, skill54;
var id_counter;

function check_death_id()
{
if(event_type == EVENT_IMPACT)
{
if(you.ent_id == 1) && (you.health <= 0)//enemy dies trough a collision
{
id_counter = 0;
enemy_count -= 1;
ptr_remove(you);
}

if(you.ent_id == 2) && (you.health <= 0)
{
id_counter = 1;
enemy_count -= 1;
ptr_remove(you);
}

if(you.ent_id == 3) && (you.health <= 0)
{
id_counter = 2;
enemy_count -= 1;
ptr_remove(you);
}

if(you.ent_id == 4) && (you.health <= 0)
{
id_counter = 3;
enemy_count -= 1;
ptr_remove(you);
}

if(you.ent_id == 5) && (you.health <= 0)
{
id_counter = 4;
enemy_count -= 1;
ptr_remove(you);
}
}
}

action enemy_creator()
{
...
check_if_I_have_to_create:
while(1)
{
if(enemy_count < max_enemy_count) //No enemies created yet or there are dead ones
{
ent_create("speeder.mdl",my.x,enemy_flight);
enemy_count += 1;
}
else//there are 5 enemies created atm and everyone is alive
{
break;
}

wait(5);
}
goto check_if_I_have_to_create;

}

action enemy_flight()
{

id_counter += 1;
my.ent_id = id_counter;

my.ENABLE_IMPACT = ON; // sensible for push collision
my.emask |= ENABLE_IMPACT;
my.event = check_death_id;
...

}



This code is not tested, maybe you can use the logical process behind it...
Important is, that you make sure that the "you" pointer is the hitten entity.
You can control this by using the impact-event(my.ENABLE_IMPACT = ON;) in the right action (for example on an action for a bullet or a player that hit the enemy).

cheers

zwecklos

Last edited by zwecklos; 02/27/08 03:47.