Closed tag2015 closed 7 months ago
This problem reproduces since 3.3.0 (the first open source version released)...
There's definitely a difference in engine logic.
Sorry for delay, I was distracted by the recent 3.6.1 release and other things...
Since this is an old game, and happen to contain room script texts inside the room file, I managed to extract room scripts using our crmpak tool.
The room10's script has this:
function hotspot1_a() {
// script for hotspot1: Any click on hotspot
RestartGame();
PlayVideo("data/r00m0.cfg", 1, 1);
NewRoomEx(1, 180, 160);
EnableCursorMode(0);
EnableCursorMode(1);
EnableCursorMode(2);
EnableCursorMode(3);
EnableCursorMode(4);
EnableCursorMode(5);
EnableCursorMode(7);
EnableCursorMode(8);
EnableCursorMode(9);
EnableCursorMode(10);
}
So, there's completely unnecessary RestartGame() call, which is supposed to reload a previously made restart point, followed by playing a intro video, and then a NewRoom call, changing to room 1.
I suppose the old interpreter could either schedule and execute both RestartGame and NewRoom in the same order, or overwrite previously scheduled action if a new one is logically overriding.
I did an experiment, started a game in a very old AGS editor:
ObjectOn(1);
RestartGame();
NewRoom(2);
After starting the game, going to room 2 and then back to room 1, one can see that the object is now visible. This means that RestartGame() was not called, because that would reset object's state to initial (disabled).
Here I am making an assumption that the RestartGame is skipped in this case.
Curiously, two NewRoom commands cause an error.
EDIT: at the same time, commands like SaveGame, SaveGameDialog etc, do not cancel RestartGame. In their case, the save/dialog is executed first, and RestartGame only after.
UPD: behavior had changed between AGS 2.62 and 2.70.
@tag2015 I tried to emulate the pre-2.70 behavior by removing all scheduled RestartGame calls in case there's a NewRoom call: 0711b6fdc0f1c71c341716a20de0d90a75f1ec92
Thanks for looking into this! I'll try your fix
Confirmed working, thanks!
Describe the bug Earl Mansin - The Breakout crashes when starting a new game with: NewRoom: Cannot run this command, since there was a RestartGame command already queued to run in "Room script", line 31!
Seems like a bug in the old interpreter queue logic?
AGS Version Latest 3.6.0 / 3.6.1
Game https://archive.org/details/Earl_Mansin
To Reproduce Start new game
Desktop Win10