Opened 16 years ago
Closed 15 years ago
Last modified 4 years ago
#3311 closed defect (fixed)
AGI: The -x command-line option appears to be broken
|Reported by:||eriktorbjorn||Owned by:||bluegr|
Latest SVN snapshot
If I try to use the -x command-line option to restore a saved game, things don't seem to work quite as intended. I tried with the English PC versions of King's Quest 1, Space Quest 2, and Leisure Suite Larry 1, where I saved at the very beginning of the game.
In LSL1, it restored the game but didn't give me a command prompt.
In SQ2, it restored the game, but showed me the end of the intro cutscene.
In KQ1 it seemed to work, but...
...perhaps just as seriously, if I tried to restore another savegame from within the game, it would fail with a warning like:
WARNING: This save seems to be from a different AGI game (save from KQ1, running ), not loaded!
It appears that _game.id isn't properly set. I think this is usually done by a set_game_id() opcode.
Ticket imported from: #1751483. Ticket imported from: bugs/3311.
Change History (10)
comment:1 by , 16 years ago
comment:2 by , 16 years ago
comment:3 by , 16 years ago
I don't seem to get the -x / --save-slot parameter to work at all. It doesn't restore anything. Tried with KQ2 and PQ1 PC versions and with ScummVM 0.10.0 and the latest SVN. Investigating...
comment:4 by , 16 years ago
Using the newest SVN it seems that --save-slot=NUM / -x NUM is indeed correctly parsed from command line and set as the save_slot-key's value in the configuration manager. But for some unknown reason that value doesn't get to the AGI engine's end at all. If I try ConfMan.hasKey("save_slot") in the AGI engine I get false and ConfMan.getInt("save_slot") results in -1. I'm flabbergasted as to why.
comment:5 by , 16 years ago
Strange, the "save_slot" setting reaches the engine just fine for me, and agiInit() calls loadGame() because of it.
comment:6 by , 16 years ago
Oh well, it seems that I just wasn't using the command line parameter correctly. I did give the --save-slot=NUM i.e. -x NUM parameter alright but didn't give a game on the command line but instead chose it using the launcher.
The save_slot gets put in a transient domain (kTransientDomain) in the configuration manager and the whole transient domain gets cleared when loading a game using the launcher. So no wonder the value never got to the AGI engine :-).
Now I can reproduce the bug. It's broken alright. I also got the menus to disappear when loading some savegame for Police Quest I's PC version. And when I tried accessing the menus I got thrown back to the debugger with an error message.
As I didn't come up with a good way to fix this and I'm starting work on finishing the Apple IIGS sound support I'll put this one back to the pool.
comment:7 by , 16 years ago
comment:8 by , 15 years ago
|Status:||new → closed|
comment:9 by , 15 years ago
The problem here is that we're trying to load a game before the game runs its initial scripts. If these don't run, the game's menu is never created, thus all those weird issues occur.
I made the assumption that the game finishes initializing right after it has created the menu, which is where I've moved the code that loads savegames from the command line.
Initial testing with almost all Sierra AGI games shows them to be working, therefore I'm closing this for now
comment:10 by , 4 years ago
|Component:||→ Engine: AGI|
I'll try to nail this bug during the next few days.