Save Feature Implementation and Information
I think Im Dead
30 Dec 2003, 09:08I'd like to formally request some in depth information on what exactly is saved in the .qsg files and how we can manipulate it. Alex, you really haven't managed to give us any info on how the save process works. All of my battle engines so far crash questnet when a save is made to the game containing objects made created during the game. I'll be punching something together tomorrow as I'll have some time off, so hopefully I can volunteer some information on what I learn. Alex could you please explain in some depth to us how the save state fworks, what information it saves, etc.
Alex
30 Dec 2003, 13:30It basically saves the state of everything in the game. Where every object is, all its properties, plus the states of timers and variables etc. It also keeps a record of objects and exits which have been created. This means that when a game is loaded from a QSG, everything should be exactly the same as before. If you have code which demonstrates otherwise, please send it to me!
I think Im Dead
30 Dec 2003, 19:52I'm having a bit of trouble getting Questnet to load a QSG file of a game in which additional objects have been created. I started off with a whole new piece of code, and the problem occurs when a player has used the "create object <whatever>" command. Save the game from the server, shut it down, load the save game and get a "Runtime error 9; subscript out of range" error. Here's the code, shed a little light on why it's not working if you can.
Some stuff like the accounts room were in there for other things I wanted to mess around with, they aren't of any importance in this though. I know I haven't used any of the onload or beforesave pieces yet, but a simple object added to room should save right I'm assuming.
"QuestNetRC Test"
define game <Release Canidate Test>
asl-version <350>
start <login>
game info <For Test Purposes>
error <badcommand; I don't understand what you typed.>
error <badthing; I could not find what you were referring to.>
error <badplace; You can't go there.>
error <itemunwanted; Your offer has been declined.>
error <defaultuse; I don't understand what you typed.>
error <cantdrop; For some reason you can't drop that.>
error <noitem; I could not find what you were referring to.>
error <badexamine; What is it you would like to examine?>
error <badgo; You can't go there.>
error <baduse; I don't understand what you typed.>
error <badgive; Give to whom?>
error <badtake; You can't pick that up.>
error <baditem; I could not find what you were referring to.>
error <baddrop; You are not holding that.>
error <badpronoun; I could not find what you were referring to.>
error <defaultout; You can't go there.>
server start script
background <black>
foreground <white>
'specifies room appearance
description {
msg <[$objectproperty(#quest.currentroom[userid]#; title)$]>
if ( #quest.formatobjects[userid]# <> ) then msg <$objectproperty(#quest.currentroom[userid]#; look)$ You also see here #quest.formatobjects[userid]#.> else msg <$objectproperty(#quest.currentroom[userid]#; look)$>
if not <#quest.doorways.dirs[userid]#> then msg <Obvious exits: none> else msg <Obvious exits: #quest.doorways.dirs[userid]#>
}
startscript {
}
player startscript {
property <player%userid%; name=$name(player%userid%)$>
background <black>
foreground <white>
panes off
}
command <create object #new-object#> if ( $objectproperty(player%userid%; name)$ <> Admin ) then msg <I don't understand what you typed.|n> else {
create object <#new-object#; #quest.currentroom[userid]#>
}
end define
define room <login>
properties <title=QuestNet RC Test - Login; look=Please use the LOGIN command to get started.|n>
end define
define room <accounts>
define object <admin>
properties <name=The Administrator; usrlvl=5>
end define
end define
Some stuff like the accounts room were in there for other things I wanted to mess around with, they aren't of any importance in this though. I know I haven't used any of the onload or beforesave pieces yet, but a simple object added to room should save right I'm assuming.
Alex
30 Dec 2003, 23:34Thanks for reporting this. I've now fixed the problem.
On the way I spotted that somehow the server welcome message was spilling into the status variables box. Annoyingly this didn't happen in the development version, but only when compiled to an EXE. I've found a way around this and the fix is in the soon-to-be-released Quest 3.51.
On the way I spotted that somehow the server welcome message was spilling into the status variables box. Annoyingly this didn't happen in the development version, but only when compiled to an EXE. I've found a way around this and the fix is in the soon-to-be-released Quest 3.51.