"Restart Layout" question

Discussion and feedback on Construct 2

Post » Mon Mar 03, 2014 5:48 pm

This isn't really a bug (I think) nor is it something I need help on (now that I know how this event works)...so this seems like a fitting sections for this post...

I'm simply wondering if Restart Layout is supposed to destroy all objects. This caused me some unexpected "bugs" in my capx until I realized what was going on when I ran that action. On one hand, it does make sense. If not destroyed, then the objects remain and it's hard to reset the layout from the beginning with the prior objects still there. However, as I said, this resulted in some unexpected consequences, namely because I have other events that check for when certain objects are destroyed while the game is running. That resulted in some variables having incorrect starting values when the layout restarted.

It would seem to me that Restart Layout shouldn't give On Destroyed any "heads up" while resetting everything.
I'm seeking Narnia. Who wants to come with me! Aslan is on the move!
B
141
S
23
G
8
Posts: 790
Reputation: 15,017

Post » Mon Mar 03, 2014 7:09 pm

Rhindon wrote:This isn't really a bug (I think) nor is it something I need help on (now that I know how this event works)...so this seems like a fitting sections for this post...

I'm simply wondering if Restart Layout is supposed to destroy all objects. This caused me some unexpected "bugs" in my capx until I realized what was going on when I ran that action. On one hand, it does make sense. If not destroyed, then the objects remain and it's hard to reset the layout from the beginning with the prior objects still there. However, as I said, this resulted in some unexpected consequences, namely because I have other events that check for when certain objects are destroyed while the game is running. That resulted in some variables having incorrect starting values when the layout restarted.

It would seem to me that Restart Layout shouldn't give On Destroyed any "heads up" while resetting everything.


I'm not sure, but I use Save when the layout start like:

on start layout or after some event, save a new slot name "repeat_level", if I need to reload everything because the player lost, just recall the "repeat_level".

but I'm not sure if is the best way, I never use restart layout in my "experiments" for now :D
B
21
S
9
Posts: 298
Reputation: 2,967

Post » Mon Mar 03, 2014 7:15 pm

@Ribis - That's a feature I haven't explored using yet. Still much to learn...but that's definitely something I should explore as it'll probably come in handy for the bigger project I'm working on.
I'm seeking Narnia. Who wants to come with me! Aslan is on the move!
B
141
S
23
G
8
Posts: 790
Reputation: 15,017


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 15 guests