PDA

View Full Version : Screen registers (D[])



pkmnfrk
07-09-2007, 10:32 PM
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.

DarkDragon
07-09-2007, 10:38 PM
I think global variables are the only ones which are saved across sessions.

pkmnfrk
07-09-2007, 10:41 PM
Wait, globals ARE saved?

...

Durrrr. I feel stoopid

DarkDragon
07-09-2007, 11:27 PM
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 ;)

pkmnfrk
07-09-2007, 11:34 PM
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?

DarkDragon
07-10-2007, 12:01 AM
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.

Dan Furst
07-10-2007, 09:51 AM
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?

DarkDragon
07-10-2007, 10:35 AM
Yes, that would be entirely possible, though I think it needs to wait until post-2.5.

pkmnfrk
07-10-2007, 07:53 PM
Just out of curiosity, how close are we to 2.5? (Since I know you don't get asked this nearly enough)

DarkDragon
07-10-2007, 11:33 PM
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.

pkmnfrk
07-10-2007, 11:56 PM
2.50 will be released "when it's done." ;)
We don't want a repeat of 2.10.

Fully understood.


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. :)