Announcement: Be excellent to each other.


Caravel Forum : DROD RPG Boards : RPG Bugs : Variable settings lost on restore
New Topic New Poll Post Reply
Poster Message
Tahnan
Level: Smitemaster
Avatar
Rank Points: 2459
Registered: 11-14-2005
IP: Logged
icon Variable settings lost on restore (0)  
I can't be all that specific about when this happens, because it doesn't seem to happen with all my saved games, but: in Dischorran's level set, Washed Ashore, the saved games seem to be missing the variable on the sword that sets its attack. So I attack something, the sword becomes +3, I quicksave; but my save gives my attack still as "10".

Note that this happens with the "continue" save game as well--if I go to the menu and press "P" to continue playing, I'm fine, but if I quit the game and come back, or otherwise restore to the "continue" slot, the sword's attack bonus is gone.

(Using the demo, 1.0.1.47, Windows.)
09-21-2008 at 03:25 AM
View Profile Send Private Message to User Show all user's posts High Scores This architect's holds Quote Reply
Dischorran
Level: Smitemaster
Avatar
Rank Points: 3408
Registered: 09-10-2005
IP: Logged

File: Washed Ashore beta 3.drh (4.8 KB)
Downloaded 35 times.
License: Public Domain
icon Re: Variable settings lost on restore (+1)  
I think the scripting bug's been fixed for the hold, but here's what happened:

I have a sword that copies the defense of whatever it's attacking, stores it in a cache variable, and sets the sword's attack to the value of the cache the next turn. The sword initializes using this variable, which being undefined at the start of the game causes the attack to be set to 0. So everything starts out fine.

However, when the game is saved and restored, the cache variable retains its value, but the sword's attack starts back at 0. Adjusting the script to update the sword's attack *each turn* instead of just after each monster engagement solves this.

Since the hold's been fixed, I've attached the unfixed hold here for comparison.

____________________________
Click here to view the secret text

09-21-2008 at 04:17 AM
View Profile Send Private Message to User Send Email to User Show all user's posts High Scores This architect's holds Quote Reply
mrimer
Level: Legendary Smitemaster
Avatar
Rank Points: 5056
Registered: 02-04-2003
IP: Logged
icon Re: Variable settings lost on restore (0)  
Dischorran wrote:
However, when the game is saved and restored, the cache variable retains its value, but the sword's attack starts back at 0.
Hmm...I wondering whether there is a bug here? Custom inventory should retain their statistics (e.g. _MyATK) when restoring game. If this isn't so, please let me know and I'll fix it.

____________________________
Gandalf? Yes... That's what they used to call me.
Gandalf the Grey. That was my name.
I am Gandalf the White.
And I come back to you now at the turn of the tide.
09-23-2008 at 04:33 PM
View Profile Send Private Message to User Send Email to User Show all user's posts High Scores This architect's holds Quote Reply
TFMurphy
Level: Smitemaster
Rank Points: 3118
Registered: 06-11-2007
IP: Logged
icon Re: Variable settings lost on restore (+1)  
There *is* still a bug here. If you look at Dischorran's latest beta of Washed Ashore, you can do the following:

1) Start New Game.
2) Kill one of the roaches and wait a turn. Your ATK will increase to 12.
3) Quit to the main menu. This saves a Continue slot.
4) Manually Restore to the Continue slot (don't select Continue Playing).
5) Hit 'R' to restart the room.

You will now be at the start of the room, but with the improved ATK for killing the roach.

There seems to be a serious underlying issue regarding variables and how well they respect Undo and game saves. Note that this topic regarding the main hold also exhibits problems with game variables in this respect.

[Last edited by TFMurphy at 09-23-2008 07:04 PM]
09-23-2008 at 06:52 PM
View Profile Send Private Message to User Show all user's posts This architect's holds Quote Reply
Dischorran
Level: Smitemaster
Avatar
Rank Points: 3408
Registered: 09-10-2005
IP: Logged

File: Washed Ashore beta 6.drh (5.2 KB)
Downloaded 36 times.
License: Public Domain
icon Re: Variable settings lost on restore (+1)  
Here's said latest beta, since I'm likely to keep mucking around with the one in the architecture thread. Maybe there's still a workaround that I haven't found yet.

____________________________
Click here to view the secret text


[Last edited by Dischorran at 09-23-2008 08:57 PM]
09-23-2008 at 08:55 PM
View Profile Send Private Message to User Send Email to User Show all user's posts High Scores This architect's holds Quote Reply
Dischorran
Level: Smitemaster
Avatar
Rank Points: 3408
Registered: 09-10-2005
IP: Logged

File: Washed Ashore bug demo.drh (5.2 KB)
Downloaded 36 times.
License: Public Domain
icon Re: Variable settings lost on restore (+1)  
And one final variant, closer to Tahnan's report. Now I'm setting the weapon's _MyATK directly from _EnemyDEF once a monster's engaged, without storing it in MBladeCache first. I can restart the room fine. However, the game remembers only remembers the weapon ATK through a save/restore if I killed an enemy in the present room. Also, restoring and then restarting the room resets the weapon's ATK to 0 instead of what it was when entering. I.e.:

1. Start game.
2. Kill roach, making ATK 12, and move to 1N. Attack on entering is 12.

3. Save/restore. Attack is back to 10.

OR: Repeat 1 and 2.
3. Kill wraithwing. ATK is 13. Restart room and ATK resets to 12, which is correct. Or, save and restore and ATK stays 13, which is correct. But save, restore, and restart room, and ATK is 10.

Leaving the proper ATK value in a global variable and resetting it each turn masks all but this last problem. Hopefully this adds something to TFMurphy's analysis.

____________________________
Click here to view the secret text

09-23-2008 at 11:53 PM
View Profile Send Private Message to User Send Email to User Show all user's posts High Scores This architect's holds Quote Reply
mrimer
Level: Legendary Smitemaster
Avatar
Rank Points: 5056
Registered: 02-04-2003
IP: Logged
icon Re: Variable settings lost on restore (0)  
Dischorran wrote:
And one final variant, closer to Tahnan's report. Now I'm setting the weapon's _MyATK directly from _EnemyDEF once a monster's engaged, without storing it in MBladeCache first. I can restart the room fine. However, the game remembers only remembers the weapon ATK through a save/restore if I killed an enemy in the present room. Also, restoring and then restarting the room resets the weapon's ATK to 0 instead of what it was when entering. I.e.:

1. Start game.
2. Kill roach, making ATK 12, and move to 1N. Attack on entering is 12.

3. Save/restore. Attack is back to 10.
...
Seems to be a symptom of the same bug causing var weirdness when saving/loading in rooms with the machines in Tendry's Tale. Now that the bug is fixed in the new patch, I'm not seeing this happen.

____________________________
Gandalf? Yes... That's what they used to call me.
Gandalf the Grey. That was my name.
I am Gandalf the White.
And I come back to you now at the turn of the tide.
10-13-2008 at 03:35 AM
View Profile Send Private Message to User Send Email to User Show all user's posts High Scores This architect's holds Quote Reply
New Topic New Poll Post Reply
Caravel Forum : DROD RPG Boards : RPG Bugs : Variable settings lost on restore
Surf To:


Forum Rules:
Can I post a new topic? No
Can I reply? No
Can I read? Yes
HTML Enabled? No
UBBC Enabled? Yes
Words Filter Enable? No

Contact Us | CaravelGames.com

Powered by: tForum tForumHacks Edition b0.98.8
Originally created by Toan Huynh (Copyright © 2000)
Enhanced by the tForumHacks team and the Caravel team.