Container bug?

For questions about using Classic.

Post » Tue Sep 30, 2008 2:15 pm

I have a container for the player and all his parts. When the player overlaps a door object, I change to the next layout and spawn the character in the new layout through an event. This seemed to work fine, but when I looked at the debugger, it retained the character from the previous layout. I figured then that I should destroy the player object when he exits the layout. When I destroy the player object though, it doesn't seem to destroy everything in the container. When I look at the debugger, I can see that there is only 1 player object but multiples of everything else in the container.

Here is a cap file: [url:3k5oxptl]http://louisferina.com/games/AAG_help01.cap[/url:3k5oxptl]

If you debug the cap file, move to the right (by pressing D) and fall down the hole. You'll pass one layout and enter another. Look at the debugger and youll see one Player object (only one because im destroying it on exiting the layout then creating it again on the new layout). However, the other objects in the player container don't get destroyed and there are 3 of each: CameraObject, detectorR, detectorL, and Part_Dust. Shouldn't they be destroyed also? Is there a better way to spawn the player per layout?

Thanks, appreciate any help.
B
77
S
49
G
25
Posts: 346
Reputation: 17,409

Post » Tue Sep 30, 2008 2:49 pm

Instead of creating the player object and all of its detectors on the next layout through events, maybe you should just place another instance of it there in the layout editor? maybe that would solve it? I don't know exactly what you are going to do here, Im assuming you want zelda like scrolling right? well I did that for a platformer but I dont know if that is what you are aiming for.
I edited your .cap to show you what I'm trying to say.

http://www.fileshack.us/get_file.php?id ... evised.cap
B
2
S
1
G
4
Posts: 239
Reputation: 1,778

Post » Tue Sep 30, 2008 2:59 pm

Thanks for the reply. However that didn't seem to fix the problem. If you still look at the debugger there are multiple instances of the objects, when i just need one. I guess I'm looking to be optimized. Also, Im trying to use events so that if I change the objects in the player container, it will automatically update the other layouts, rather than paste the new objects into 100+ layouts.
B
77
S
49
G
25
Posts: 346
Reputation: 17,409

Post » Tue Sep 30, 2008 4:35 pm

oh I get what your saying now, its too bad I never use the debugger >.< I always just set my events and then run the layout and see if it works. then again I havent really made more than one layout yet. Sorry bud, I guess you need help from someone with more experience.
B
2
S
1
G
4
Posts: 239
Reputation: 1,778


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 4 guests