i'm using the lite-c beta and it allows for local pointers and arrays of pointers. in my car game each car has near the beginning of its action an empty array of pointers: ENTITY* wheel[4];
and then creates each of the wheels. when one entity creates another entity, it returns a pointer to that entity just created. so, i have a loop as follows:
Code:
var i = 4;
while(i>0)
{
i -= 1;
wheel[i] = ent_create("wheel.mdl",nullvector,wheelAct);
}

now each car has pointers to each of its wheels and can do with them however it wants.

i'm not sure if c-script (which is similar to lite-c except slightly easier and slightly less feature-rich) can use local pointers or arrays of pointers. maybe someone else can point that out. but a common use is having a global pointer declared early on in ur script (outside of any function): ENTITY* player;
then at the beginning of the main character's action you have "player = me;"
then all the badguys can refer to they player however they want (check distance between them and the player, or other stuff).

if you want to give a whole bunch of entities some sort of id, you could set one of their skills to indicate if they are a missile. for example, in the missile action, say my.skill5 = 1;
if u make sure no non-missile entities change their skill5 from 0, then u can easily find all the missiles using a while loop and ent_next(). look up ent_next in the manual -- it can be very useful. basically it is used to search through all the entities.

i hope this helps!

julz


Formerly known as JulzMighty.
I made KarBOOM!