How do you restart a game reliably?

Get help using Construct 2

Post » Sat Aug 31, 2013 7:38 am

Hello all.

I'm making a game where the player can travel between the layers at will, even back to layers they've already visited in the past. Each level has a layout. As such, everything that the player can interact with has "persist" to ensure that the object keeps its state when the player returns.

I want the player to be able to restart the game. I've scoured the forums on how to do this and I've tried all the methods I've found, including resetting global variables, restarting the layout and going back to the same layout.

None of this works!!

Objects that were destroyed stay destroyed. Objects that had their animation frame changed don't go back to their starting animation frame.

Surely there MUST be a way to restart the entire game!! I can't believe that there wouldn't be. Can anybody please tell me what the most reliable method of resetting EVERY object in the game back to its starting state?

Thank you.
B
10
S
3
G
1
Posts: 30
Reputation: 1,279

Post » Sat Aug 31, 2013 7:44 am

Yeah someone posted about resetting persist objects before and I don't think there was a proper solution as it's not possible. I offered the idea of making a save file of the default level structure and then when the player 'restarts', you silently load the save file.
B
46
S
16
G
79
Posts: 2,170
Reputation: 46,857

Post » Sat Aug 31, 2013 6:38 pm

No way to reset persistent objects?!?! That like buying a lock that has no key; useless 99.9% of the time. I suppose I'll have to set events at the beginning and end of each layout that reads and writes information to a series of arrays. Kind if sucks that that has to be done because persist is broken.

Well, I assume that it's broken. If its working as intended then it really is a dud feature!!
B
10
S
3
G
1
Posts: 30
Reputation: 1,279

Post » Sat Aug 31, 2013 6:43 pm

Yeah I believe it's as designed at the moment. Only way to reset persist is to relaunch the game. You could reset all the items to their initial locations if 'game has been reset'. That's kinda like the load/save idea I gave above though and with that you could reset everything with one click..
B
46
S
16
G
79
Posts: 2,170
Reputation: 46,857

Post » Mon Sep 02, 2013 12:45 am

Load/save idea sounds like the way to do it. Is there any word from Scirra as to whether persist functionality will ever change? Even being able to turn it on and off would be a pleasant start.
B
10
S
3
G
1
Posts: 30
Reputation: 1,279


Return to How do I....?

Who is online

Users browsing this forum: sean080, TRMG and 36 guests