@Xarthor: Yeah I've coded it that or a similar way a few times, but my experience is that once in a while I get the code to proceed past the while loop. Why that happens is unclear. It shouldn't. I know the code in the post is not pretty but it works. In any case I would keep the line with -= 1 count down for each removed ent to keep the current enemy ent number between 0-5.

@JokeSpeaker: Do you mean that you want each enemy to have its own pointer id? You give each new created enemy that by keeping a running count as said earlier. Keep the var "total_enemies_created" counter in the beginning of the enemy action. Not sure I understand exactly what you want to accomplish ...

cheers,