PDA

View Full Version : Savestate... save, autosave?



speeder
07-03-2010, 03:17 AM
nice new forum layout btw!

I have the following problem, that I made some workarounds even, but they are not really helping...

How I save some variables on quit? Like language, and last level visited?

Also, how I allow the player to manually save his game and load?


Btw: I am NOT using profiles (because they got into the way of editing... autosave also got in the way, so it is disabled on all maps but the high-scores ones, that did not autosaved anything and I made a save map function to allow me to save the high-scores myself)

speeder
07-03-2010, 10:02 PM
This is not a bump, I am actually replying to myself, so that when someone come here searching for the answer it is provided!


The manual states that this could be done using WorldData() that don't exists. This is why I asked the question (in fact, I even forgot about the theoretical existence of WorldData after I noticed it don't de-facto existed).

My solution was... implement WorldData!

So, use WorldData! (when I clean-up the mess I made in my branch of novashell, I will send the patches to Seth, including the WorldData fix)

Seth
07-03-2010, 11:04 PM
The manual states that this could be done using WorldData() that don't exists. This is why I asked the question (in fact, I even forgot about the theoretical existence of WorldData after I noticed it don't de-facto existed).


Er, I just checked and GetGameLogic:WorldData() does in fact exist.. are you using the latest version of novashell? Use a global search on the source for "WorldData".

speeder
07-04-2010, 03:47 AM
I got novashell from SVN...

And yes, WorldData... half-exist.

It is implemented everywhere in the source, it is even used internally, but it was not available to Lua. :D (that is good, because I would not figure how to make a worlddata from scratch myself...)

Seth
07-04-2010, 11:33 AM
It is implemented everywhere in the source, it is even used internally, but it was not available to Lua.

Er.. but in MiscClassBindings.cpp there is


.def("WorldData", &GameLogic::WorldData)

Which lets Lua access it (using GetGameLogic:WorldData() )... I use this in Mind Wall PC/Mac I believe. Isn't this in your version?

speeder
07-04-2010, 05:17 PM
Nope!

I added myself.

Seth
07-04-2010, 09:34 PM
Ahh, you're right - that wasn't in svn, but it was in the latest precompiled .exes... I just committed to svn. Sorry for the hassle!