Save Layout State

Get help using Construct 2

Post » Mon Nov 03, 2014 3:02 pm

I am going have 2000 posts in no time here!

Ok here is the .capx

https://www.dropbox.com/s/kgij7r3db6zpu ... .capx?dl=0

What happens in my game is that when you enter the building a menu opens which is in a different layout because somewhere here on the forums they said use another layout instead of just using opacity, easier and cleaner. Please try it and see and thanks again for all the help to a wanna be Construct 2 developer.
B
9
S
1
Posts: 56
Reputation: 576

Post » Mon Nov 03, 2014 3:05 pm

Oh and yes I have searched game layouts, save states, layout disappearing etc etc with no luck :) Is there maybe other resources for information or is this it, Tutorials, This Forum. Is there another community with more information?
B
9
S
1
Posts: 56
Reputation: 576

Post » Mon Nov 03, 2014 8:27 pm

So does anyone have the slightest of clues as to why the main layout looses all information and resets it on return from another layout?
B
9
S
1
Posts: 56
Reputation: 576

Post » Mon Nov 03, 2014 9:02 pm

you set checklevelpaint to 1 after the tiles are created
spawnarray is global, so it keeps the instance variable at 1
so when the layout is revisited the tiles are not created again.
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Mon Nov 03, 2014 9:05 pm

I guess what you are looking for is persist behaviour:

https://www.scirra.com/manual/161/persist
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Mon Nov 03, 2014 9:51 pm

Yes, I added persist behavior to the sand32x32 tile and that fixed the problem.
I had to add the check for CheckLevelPaint because if I did not the program kept repainting the background tile constantly. Once I added a check if != 1 then run the array loop it worked good.

Thx once again for the persist information. Its hard to go from C++ to this because you constantly want to 'write' the functions when they actually already exist hehe.
B
9
S
1
Posts: 56
Reputation: 576


Return to How do I....?

Who is online

Users browsing this forum: lukewasthefish and 13 guests