Posted By: seecah
removing entity - 11/13/09 04:25
Hello Guys,
I need your ideas to help me solve my problem. I have an entity action that is making another entity inside..
Indeed, you entity is a Pearl while my entity is a Shell..
I can't use a single global ENTITY* declaration since I'll be making variable number of Shell entities with action "act_shellpearl"
Now my problem is how to remove the you entity (Pearl) inside the "shellpearl_event" function.. during that event, the Shell will be removed and so as the Pearl must be.. but I can't use you pointer to remove the Pearl entity since it's already on another function..
Please advise..
Thanks,
Sedrix
I need your ideas to help me solve my problem. I have an entity action that is making another entity inside..
Code:
void act_shellpearl() { you = ent_create("pearl28.dds", vector(my.x, my.y, my.z + 2), NULL); you.tilt = 90; you.ambient = 100; you.scale_x = 0.8; you.scale_y = you.scale_x; set(you, PASSABLE | INVISIBLE); my.emask |= (ENABLE_IMPACT | ENABLE_ENTITY | ENABLE_SCAN | ENABLE_DETECT); my.event = shellpearl_event; while(1) { //action of the my entity.. // I have to toggle here the visibility of the you entity } ent_remove(me); }
Indeed, you entity is a Pearl while my entity is a Shell..
I can't use a single global ENTITY* declaration since I'll be making variable number of Shell entities with action "act_shellpearl"
Now my problem is how to remove the you entity (Pearl) inside the "shellpearl_event" function.. during that event, the Shell will be removed and so as the Pearl must be.. but I can't use you pointer to remove the Pearl entity since it's already on another function..
Please advise..
Thanks,
Sedrix