Page 1 of 1
initial settings unusual issue
Posted: Fri Feb 06, 2015 6:16 pm
by Granamir
Just discovered that saving game in my custom dungeon, closing game and starting again, then loading saved game doesn't load all of initial settings.
In some maps i used 'setWorldPositionY(number)' and 'setSubtileOffset(n, m)' in a script object (outside of a function), to place items exactly where i want, and works almost always good. Unfortunately i discovered that after exporting my dungeon if i save my position and continue playing later (after closing and loading again the game) some of those settings are loaded properly some other doesn't; even in same script object some settings are loaded someone else doesn't. Can't imagine why.
Anyone has encountered same or similar problem? Anyone has some clue to help me solve this really big problem.
Re: initial settings unusual issue
Posted: Fri Feb 06, 2015 6:21 pm
by Batty
minmay wrote:
minimalSaveState
Objects defined as having "minimalSaveState" will have only minimal properties saved: their name, id, x, y, elevation, and facing. minimalSaveState should be used on objects such as walls and floors that won't change during gameplay. If you are changing the object in any way - using setWorldPosition, setWorldRotation, doing anything to its components such as setting wall text, etc. - then minimalSaveState is not appropriate. If you're confused, use the asset pack as a guide.
Read me.
Re: initial settings unusual issue
Posted: Sat Feb 07, 2015 2:00 pm
by Granamir
So if i understood well, i'm not a programmer, those objects that have minimalsavestate=true in theyr code have this 'issue'...
I thought that every time i load the game it read every script object and execute every line of code outside a function...was i wrong? does it execute them only first time, when entire dungeon is created?
...so i'm keeping for miself what i would to say and just ask:
how can i avoid this problem? have i to clone every object i used, to set minimalsavestate=false? is there a smarter, cleaner, easier solution?
Re: initial settings unusual issue
Posted: Sat Feb 07, 2015 2:46 pm
by JohnWordsworth
minimalsavestate is an optimization to prevent loads of information being saved for items that don't ever change (beyond x, y, level and elevation info) in a dungeon. For instance, saving trees and statues and the like with minimal info makes the save much smaller and faster to read/write.
ScriptEntities are only run the first time a dungeon starts. Otherwise, every time you load a save, everything created by script entities would be created again (including defined functions etc).
If you have a specific type of item you are placing super specifically (setSubtileOffset) you may need to redefine those objects to not use minimal save state. It's probably a bad idea to just turn this off on everything though - as the save files would be massive.
Re: initial settings unusual issue
Posted: Sat Feb 07, 2015 3:21 pm
by Granamir
Thank you John.
I used subtile offset and world position Y a lot of times...
So if the only solution is to redefine those objects... ...
is there an easy way to know if an object has or not minimal save state true? except opening all asset pack lua files and reading it directly in object code?
... i feel like tired of building my dungeon.
Re: initial settings unusual issue
Posted: Sun Feb 08, 2015 12:35 am
by JohnWordsworth
There is an easy solution to list all assets with this as true, but I will need to be on my home PC to test it out! Will try to do so tomorrow night when I get home. The same solution could be used to just provide a list of all assets you want to change this property for without having to manually redefine each one separately.
Re: initial settings unusual issue
Posted: Mon Feb 09, 2015 11:39 am
by Granamir
Thank you John.
Only solution i know for now is using a tex editor and make him find and replace any 'minimalsavestate=false', but unless u want to change every object in the game is hard to use for just some object u need.