Save/Load Scene

I'm making a simple storybook, nothing crazy, just learning. I want to save the current scene (page) when the app is closed and/or the menu button is pressed.
My initial approach::
Catalog each scene with a PageNum Attribute. (11 pages/scenes) After each page is turned, the PageNum is decreased by 1. So when I hit the menu button on Scene/Page 5...the PageNum would equal 6, which would then be saved as "LastPage". Then resuming would call up the LoadAttribute, which would load "LastPage" and set PageNum to 6. BTW, each page is a separate scene currently.
Is this approach correct? Or is there a simpler way to just save the current scene, instead of tracking a PageNum attribute.
My initial approach::
Catalog each scene with a PageNum Attribute. (11 pages/scenes) After each page is turned, the PageNum is decreased by 1. So when I hit the menu button on Scene/Page 5...the PageNum would equal 6, which would then be saved as "LastPage". Then resuming would call up the LoadAttribute, which would load "LastPage" and set PageNum to 6. BTW, each page is a separate scene currently.
Is this approach correct? Or is there a simpler way to just save the current scene, instead of tracking a PageNum attribute.
Best Answers
-
jckmcgraw Posts: 647
@plutogames
One thing I would recommend if you are making a book is to have most of the pages on one scene and have a camera actor move to the next section on the scene (the next pages). This way, you won't have a loading wheel every time you switch pages. Just a thought. If you want help with that, I can send you a demo (I use that method for my menu).
Good luck,
Jack McGraw -
jckmcgraw Posts: 647
@PlutoGames
Here is a quick demo I whipped up for you. I hope it helps you out!
http://dl.dropbox.com/u/16233669/cam demo.gameproj.zip
Let me know if you have any questions about it... I tried to add some notes to help clarify a couple of things.
Regards,
Jack McGraw
Answers
Sounds like that should work.
One thing I would recommend if you are making a book is to have most of the pages on one scene and have a camera actor move to the next section on the scene (the next pages). This way, you won't have a loading wheel every time you switch pages. Just a thought. If you want help with that, I can send you a demo (I use that method for my menu).
Good luck,
Jack McGraw
I initially had all the pages in once scene, but couldn't get each element of the pages to be timed correctly. (every page has elements which are interpolating, and when the Next button was spammed, there would be elements from previous pages appearing on other pages...etc)
I'll give it another try tho.
Regarding the Save/Load. If i do each page in one scene, would I then have to give each page it's own X,Y coordinate? And then just call up the coordinate to be saved/loaded? All I want to do is have something that is always being updated with the current page, after every page turn. lol Seems so simple when
I like this camera setup, i'll give it a try. My only worry is that when I have 10+ pages, keeping everything centered and arranged may become a frustration. The beauty of it is, I can keep better track of the scene state which is great. What about loading/unloading images? Wont all the images be loaded into memory?
Really appreciate the help!
The %4 means that it will include 4 digits including 0 (0,1,2,3). Once it reaches 3, since it is %4, it will go back to 0 instead of continuing onto 5 then 6, ect. I don't quite understand how the % sign cam to be, but it works. What do you mean by that? Just use some math and keep all of the major X and Y coordinates written down on a table or something (use planning other than GS to stay organized).
Regards,
Jack McGraw