Save layout state

Get help using Construct 2

Post » Wed Oct 09, 2013 5:36 pm

Is there a way to save the state of a layout as the player moves between them?

So player character moves a box in layout A, then player transitions to layout B, when he returns to layout A - the box is still moved.

I know I could do this by recording the position & angle of the objects before the player leaves the layout but I'm working with a LOT of physics objects and they move around wildly so this would be a mammoth task.

Any ideas?
B
43
S
13
G
8
Posts: 612
Reputation: 7,372

Post » Wed Oct 09, 2013 5:40 pm

Image
B
81
S
16
G
4
Posts: 501
Reputation: 8,934

Post » Wed Oct 09, 2013 5:59 pm

What I'm looking for isn't just save states or maybe it is? I'm confused, I have a game where the player moves between layouts and I want to maintain the history of the layouts within the same play session.

So player moves stuff around layout a, then moves into layout b and moves more stuff around then goes back to a and everything is as he left it, and when going back to b everything is again how he left it.

In my mind the save states work for a whole project, if you walk into layout b then back into a, you'll be essentially taking the player back in time to before he even reached b.

Does that make sense?
B
43
S
13
G
8
Posts: 612
Reputation: 7,372

Post » Wed Oct 09, 2013 6:12 pm

I would say use a mix of save states (for the actual layout saving) and Webstorage (for the actual variables for the object positions (assuming you don't have many objects you want to move around.) Use Webstorage to save your positions before moving to the next layout and when your players goes back to the other layout, you can use Webstorage to load your positions.

To be honest, there's no other way. You will have to record data including your physics data.KazaaMafia2013-10-09 18:18:07
Image
B
81
S
16
G
4
Posts: 501
Reputation: 8,934

Post » Thu Oct 10, 2013 10:51 am

yeah that's the problem and why I posted the thread, I'm using quite a lot of physics objects in a scene, that's going to be real hard to control taking note of their position and angle. I tried it once before and saw many boxes had glitched and went flying across the layout. This is why I'm curious about saving layout state instead of session state, I'd assume it's the same concept but one step removed.
B
43
S
13
G
8
Posts: 612
Reputation: 7,372

Post » Thu Oct 10, 2013 12:00 pm

Give the objects that shouldn't change the "Persist" behavior... that's all :D
B
33
S
6
G
7
Posts: 339
Reputation: 7,426


Return to How do I....?

Who is online

Users browsing this forum: ivanski1983, marcoscodas, Yahoo [Bot] and 12 guests