RunAGSGame command consistently crashes switching from Game B to Game A

Started by MIITRIN, Wed 10/08/2022 17:33:13

Previous topic - Next topic

MIITRIN

I've been messing around with the RunAGSGame function a lot. I have Game A acting as sort of a menu, so you can select the two games I currently have attached to it. Game B and Game C. And when you exit Game B or C, you'll be asked if you want to go back to Game A. I also didn't want to player to simply, open up the Game B or C exes, I want them to use Game A. So, I implemented a cheeky little GUI that tells you to use Game A, then any click you do closes the window. Now this works absolutely perfectly with Game C. I can switch between A and C flawlessly. But for some reason, every single time, Game B crashes when I exit back to Game A. I mention the "lock screen" above, because, before I added that switching between the games worked fine.

Now, I can swallow my pride and just hope the player chooses Game A by constantly saying how you should only run that exe, but if at all possible, I'd like to control this. Mainly since I wouldn't want the player to just, skip ahead to whatever Game without unlocking something in Game A. But the REAL kicker now is that even WITH that "checking for previous game data" code gone, Game B now always crashes when changing to Game A. And it is still only crash Game B.  Even though Game B has the exact same code and GUI as Game C in this scenario, Game B just won't compromise. I can understand if Game B has variables or some kind of data that's not correctly being dealt with in the transition between game's, but I'm grasping at straws and I have no idea how to debug this since it'll only work on the compiled version. If anyone can provide any help with either debugging or just, any additional info about how RunAGSGame is meant to be used, it'll be highly appreciated. I really don't want to call this a bug with the engine itself, since, I'm more than likely doing something wrong, but I have no way of knowing.

MIITRIN

To clarify: Game B and Game C aren't the same game entirely. They're two separate games with their own graphics, sound, text, etc, but what I meant was that the same "Change back to Game A" code was being used and while Game C handles that fine. Game B crashes. I've tried changing the MODE between 0 and 1. Changing which data is sent (I use game.previous_game_data to check if the player opened up Game A first. Works fine with Game C, but not B.) I just can't get it. If there's any sort of debugger I can also utilize, that'd help too

Crimson Wizard

Please, when you ask about crashes, always tell the error message you see, if any (post a screenshot if copying the message text is difficult). It could be a script error, or an engine bug, or else, in each case the solution would be different.

MIITRIN

Quote from: Crimson Wizard on Wed 10/08/2022 17:47:58
Please, when you ask about crashes, always tell the error message you see, if any (post a screenshot if copying the message text is difficult). It could be a script error, or an engine bug, or else, in each case the solution would be different.

That's gonna be a problem, because it doesn't give any text box. Here I'll show it off

https://youtu.be/D72ce3HvA9E

Crimson Wizard

Hmm, this is either a game shutting down normally for some reason, engine closing a game because it did not like something (but without any message), or a silent crash. But I think contemporary versions of Windows should at least display a notification about program not closing normally.

Not sure how much this will help, but you may enable engine logging, by placing this into a config file (acsetup.cfg):
Quote
[log]
file=all

On Windows the log should be written to "%USERPROFILE%/Saved Games/Adventure Game Studio" in 3.6.0, or "%USERPROFILE%/Saved Games/.ags" in previous versions.

By the way, this reminds me, I forgot to ask which version of AGS are you using?

MIITRIN

I'm using AGS 3.5.1.11, haven't updated to 3.6.0 yet. I'll try out that engine logging and post what I get back.

MIITRIN

Quote from: Mintaro on Wed 10/08/2022 18:47:22
I'm using AGS 3.5.1.11, haven't updated to 3.6.0 yet. I'll try out that engine logging and post what I get back.

Adventure Game Studio v3.5 Interpreter
Copyright (c) 1999-2011 Chris Jones and 2011-2021 others
ACI version 3.5.1.11

Installing exception handler
Initializing allegro
Initializing game data
Looking for the game data.
Cwd: d:/DOCUME~1/Misc/NECTUR~1/HOWDES~1/Compiled/Windows
Path arg:
Found game data embedded in executable
Located game data pak: d:/DOCUME~1/Misc/NECTUR~1/HOWDES~1/Compiled/Windows/NOCTUR~3.EXE
Opened game data file: game28.dta
Game data version: 50
Compiled with: 3.5.1.11
Startup directory: d:/DOCUME~1/Misc/NECTUR~1/HOWDES~1/Compiled/Windows/
Data directory: d:/DOCUME~1/Misc/NECTUR~1/HOWDES~1/Compiled/Windows/
Setting up game configuration
Logging to C:/Users/MIITRIN/SAVEDG~1/Adventure Game Studio/ags.log
Initializing speech vox
Voice pack found and initialized.
audio.vox found and initialized.
Setting up window
Initializing TTF renderer
Initializing keyboard
Initializing mouse: number of buttons reported is 5
Install timer
Initializing sound drivers
Sound settings: digital driver ID: 'AUTO' (0xffffffff), MIDI driver ID: 'AUTO' (0xffffffff)
Trying to init: digital driver ID: 'AXA ' (0x41584120), MIDI driver ID: 'W32M' (0x5733324d)
Installed digital driver ID: 'AXA ' (0x41584120), MIDI driver ID: 'W32M' (0x5733324d)
Install exit handler
Initialize path finder library
Load game data
Game GUI version: 119
Requested script API:  (8), compat level:  (8)
Game title: 'The Nocturne Trilogy Collection'
Checking for disk space
Initializing MOD/XM player
Initializing resolution settings
Game native resolution: 640 x 400 (32 bit)
Mouse confined: (0,0)-(639,399) (640x400)
Device display resolution: 1920 x 1080
Graphic settings: driver: D3D9, windowed: yes, screen def: scaling, screen size: 1920 x 1080, match device ratio: ignore, game scale: max_round
Built library path: d3d9.dll
Using graphics factory: D3D9
Created graphics driver: Direct3D 9
Supported gfx modes (32-bit):
   640x480;640x480;720x400;720x400;800x600;800x600;1024x768;1024x768;
   1152x864;1152x864;1280x720;1280x800;1280x1024;1366x768;1440x900;1600x900;
   1680x1050;1920x1080;
Attempting to find nearest supported resolution for screen size 1280 x 800 (32-bit) windowed
Maximal allowed window size: 1920 x 1040
Attempt to switch gfx mode to 1280 x 800 (32-bit) windowed
Succeeded. Using gfx mode 1280 x 800 (32-bit) windowed
Render frame set, render dest (0, 0, 1279, 799 : 1280 x 800)
Requested gfx filter: StdScale
Graphics filter set: 'StdScale', filter dest (0, 0, 1279, 799 : 1280 x 800)
Using gfx filter: StdScale
Mouse control: off, base: 1.000000, speed: 1.000000
Mouse confined: (0,0)-(1279,799) (1280x800)
Initialize sprites
Initialize game settings
Prepare to start game
Audio is processed on the main thread
Game : (room:-10) Cursor mode set to 0
Engine initialization complete
Starting game
Game : (room:-10) Cursor mode set to 0
Game : (room:-10) Playing music 0
WARNING: channel 2 - same clip assigned
Game : (room:-10)[G 9] Game speed set to 40
Game : (room:-10) Loading room 4
Game : (room:4) Mouse bounds constrained to (0,0)-(639,399)
Game : (room:4) Cursor mode set to 1
Game : (room:4) Room camera released back to engine control
Game : (room:4) Now in room 4
Game : (room:4)[R 5] Cursor mode set to 6
Game : (room:4) Unloading room 4
Game GUI version: 119
Requested script API:  (8), compat level:  (8)
Initialize game settings
Game : (room:-10) Cursor mode set to 0
Game : (room:-10) Playing music 0
WARNING: channel 2 - same clip assigned
Game : (room:-10)[G 15] Game speed set to 40
Game : (room:-10) Loading room 50
Game : (room:50) Mouse bounds constrained to (0,0)-(639,399)
Game : (room:50) Cursor mode set to 1
Game : (room:50) Room camera released back to engine control
Game : (room:50) Now in room 50
Game : (room:50)[R 7] GUIOff(2) ignored (already off)
Game : (room:50)[R 8] GUI 1 turned off
Game : (room:50)[R 9] GUI 0 turned off
Game : (room:50)[R 11] Cursor mode set to 6
Game : (room:50)[R 18] GUIOff(8) ignored (already off)
Game : (room:50)[R 39] GUI 7 turned on
Game : (room:50)[R 39] Game paused
Game : (room:50) Mouse click over GUI 7
Game : (room:50) Unloading room 50


so, Room 4 is the menu and Room 50 is the first game's title screen. GUI 1 was me bringing up the IconBar. And GUI 7 should be the Exit GUI

Previously, I kept repeatedly executing making the IconBar invisible in the title screen so people couldn't see it. Bad code, but it worked for a time. I turned off the RepExec so that way it didn't flood the log. I assumed that might've been the problem, but no. It still just, unloads and that's it.

MIITRIN

Update! I have just updated to AGS 3.5.1 Patch 12 and now it works! I don't know if this was a glitch only in a previous version or if my engine just weird after a while, but everything is back to how it should work.

SMF spam blocked by CleanTalk