Page 1 of 1

Saving variables

Posted: Mon Feb 02, 2015 4:20 am
by Frenchie
Can someone make a standard script to save some variables and the party state? A savegame is 2 MB in size, but how big will this 'save' become? Goal is to have a reset back to the start of a dungeon without using the load/save options of the game. It could also be used if you work in turns with 2 parties.

Some variables:
10 variables x 4 letters x 1 byte value = 40 bytes

For 1 champion:
Inventory has 32 slots x 2 bytes = 64 bytes
Stats has 10 x 2 bytes + exp x 4 bytes = 24 bytes
Skills has 16 x 3 bits ( = 8 bytes ) + unused skill points = 9 bytes
Traits 24 x 1 bit = 3 bytes
Total = 100 bytes x 4 champions = 400 bytes

Custum dungeon level:
32 x 32 squares ( = 1024 squares ) would possible have 24 or so switches x 1 bit = 3 bytes

Estimated save size : 443 bytes ( about 25% of 2 MB )

So, with the above data can someone make a 'save' and 'restore' script?

Edit : with 'save' I mean storing data to much smaller file than a savegame

Re: Saving variables

Posted: Mon Feb 02, 2015 4:40 am
by minmay
I think you are very confused about what a Grimrock mod can do. You cannot write arbitrary data to memory like that.

You cannot store the state of GameObjects because the scripting interface cannot access all of their state information.

I already explained to you how to do the specific case of "reset back to the start of a dungeon" in another thread, but I guess you decided to ignore it.

Re: Saving variables

Posted: Mon Feb 02, 2015 4:43 am
by Frenchie
No need to be rude. Just because it comes natural to you it gives me a headache and I didn't understand any of it. If you dislike being helpful to me just ignore me!