Page 1 of 1

Problems when returning to an activation region.

PostPosted: Sat Jan 14, 2006 9:00 pm
by fauldran
I am having a problem where actors created using create actor are not recreated as expected when the view reenters an activation region.
Image
Here is the basic setup^
The red circles are ghost_base that handle all the collision, variables, etc... for my AI ghost bad guys. Each circle is a clone of the AI_ghost_base actor. The brain in the top corner initialises the ghost bases and then activates them to begin moving along their specified path.
Code: Select all
strcpy(getclone2("AI_ghost_base",0)->AI_pathN, "lvl1_path1");
SendActivationEvent("AI_ghost_base.0");

strcpy(getclone2("AI_ghost_base",1)->AI_pathN, "lvl1_path2");
SendActivationEvent("AI_ghost_base.1");

When the base is activated it creates a child actor called AI_ghost_graphic. This is the part of the ghost that the player actually sees.
Code: Select all
 tempActor = CreateActor("AI_ghost_graphic", "move_SE", "Event Actor", "no path", 3, -15, false);

Image
The problem is that when the player leaves the activation region contianing the two ghosts and then walks back into it the ghosts are not recreated as expected. I end up with several random things occuring most commonly the existance of two "graphics" on one base.
Image
I also sometimes end up with copies of the ghost graphic sitting around that are not parented to any base.

Is it possible that the ghost graphics are not being attached to the activation region they are in when created or not being destroyed when the activation region is exited? I'm not sure what to try to fix this. I feel like I'm missing something that I should know.

Any thoughts would be appreciated. Thanks.

PostPosted: Mon Jan 16, 2006 12:47 pm
by makslane
I need see what's happen.
Can you send me the game?

PostPosted: Fri Jan 20, 2006 6:28 pm
by makslane
The problem is this:
You have actors created at startup (AI_ghost_base) that create other actor (AI_ghost_graphic), and with AI_ghost_base parent of AI_ghost_graphic;

The regions are linked to the actors created at startup.
For the actors created with "Create Actor" there is no warranty that will be created in the same region of the event actor, so, some times the AI_ghost_base are destroyed and AI_ghost_graphic not.

I think You can solve this problem now, by creating the AI_ghost_base in a "Create Actor" action too.