Globals and Savegames

Get help using Construct 2

Post » Sat Apr 27, 2013 7:45 pm

Hey everyone,

I just started messing with save and loading games which seems to be working but it seems like it resets Global values. So say I have a loader layout, a main layout and a menu layout. On the main layout is where all the global variables are being set as their defaults. In the menu layout you can click Save game. On the loader layout, once its loaded you can click the Load game button which loads the save and puts you in the menu layout. Once it does that, I navigate back to the Main layout and all the globals seem to be set back to their defaults. (This is after closing the browser window and reopening after saving).

So do the Globals reset to default no matter what when you navigate to the layout that uses the sheet even if you loaded from a save game after closing the window and coming back?
Twitter: https://twitter.com/pudgyplatypus

Learn to make a clicker game for cheap!
https://www.scirra.com/store/games-with ... e-game-666

Try out Pixel Golf on the Scirra Arcade!
https://www.scirra.com/arcade/sports-ga ... el-golf-67

Pudgy Platypus Games website!
www.pudgyplatypus.com
B
53
S
16
G
5
Posts: 206
Reputation: 6,826

Post » Sat Apr 27, 2013 7:58 pm

Depends if you have made it so to assign values to those variables in your main/menu layout.

Provide your capx, it will be simpler to spot where things might go wring and provide efficient help.
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 7,000
Reputation: 57,795

Post » Sat Apr 27, 2013 7:59 pm

How do you set your variables on main layout?

for example if you do something like this
+Start of layout -> var 1 set to 1
                    var 2 set to 1
                    var 3 set to 1

They will always set to these values every time you visit that layout - no matter if you save them or not.

I haven't seen your capx but I think thats your issue.
ImageImageImageImage
B
140
S
58
G
36
Posts: 2,547
Reputation: 31,170

Post » Sat Apr 27, 2013 8:42 pm

Thanks for the replies I think I got it now. I had the globals on the main layout and it seems like, if you load a game and go to a layout that has default 0s or whatever those get set again. So I just made a new layout that has a sheet just for the globals and when you do a new game it will reset those and any time after that you never go to that layout that resets them. It works, thanks guys :)
Twitter: https://twitter.com/pudgyplatypus

Learn to make a clicker game for cheap!
https://www.scirra.com/store/games-with ... e-game-666

Try out Pixel Golf on the Scirra Arcade!
https://www.scirra.com/arcade/sports-ga ... el-golf-67

Pudgy Platypus Games website!
www.pudgyplatypus.com
B
53
S
16
G
5
Posts: 206
Reputation: 6,826


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 16 guests