Are the Screen->D[0] etc. registers saved in a save game? Or, rather, should they be?
In my testing, they aren't. This is a problem, as there's currently no other way to persist arbitrary variables across game sessions.
Like, right now, I'm writing a script to control water levels, a la the Water Temple. I thought it would be a nice touch if the water level was saved in a save game, and the only way I thought to do that was to stick the water level in the first screen's D[0] register. But, when I load it up while testing, it's always 0.
I think global variables are the only ones which are saved across sessions.
That's what I remember from discussions with jman quite a while ago - don't trust me on this point until you've tried it out 😉
Well, as it turns out, I hate you forever for lying to me in a malicious manner! They don't save:
http://zctut.com/test.zip (it's up)
(it's a QSU since winzip does a better job than ZQuest at compression, and I hate dial-up)
I also included the script I'm trying to write. It's a bit arcane, how it works, but it does work.
Except, if you save, and come back, the level state will be back to the default, no matter what state it's in.
Now, if globals SHOULD be saved, then it's a bug, no?
Yes, but I'm worried about old quest compatibility. If someone can confirm that they're indeed suppose to save, go ahead and post a report.
I have no idea what they were supposed to do, but here's an idea.
It might sound a little weird, but, what if you introduced a new type declaration called "saved" ?
You would use it like this:
saved int a;
saved bool b;
This way, old scripts can continue to function normally, and new scripts can use global variables that persist through saves.
Or am I crazy?
Yes, that would be entirely possible, though I think it needs to wait until post-2.5.
Just out of curiosity, how close are we to 2.5? (Since I know you don't get asked this nearly enough)
2.50 will be released "when it's done." 😉
We don't want a repeat of 2.10.
I personally have no idea how close we are; every time it seems the bug reports are dying done, a new batch get reported.
DarkDragon wrote:2.50 will be released "when it's done." 😉
We don't want a repeat of 2.10.
Fully understood.
DarkDragon wrote:I personally have no idea how close we are; every time it seems the bug reports are dying done, a new batch get reported.
Well, better they're reported now than later. 😊