Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: paolo on Sun 27/05/2007 19:21:45

Title: Crash on using Debug in global script
Post by: paolo on Sun 27/05/2007 19:21:45
I put a Debug line my global script allowing me to jump to a room when the game starts.

When the program runs, it says "Enter new room: (in room -10)" (or sometimes "... (in room -12)". On entering a room number, the game crashes with:

---------------------------
Illegal exception
---------------------------
An exception 0xC0000005 occured in ACWIN.EXE at EIP = 0x00447F39 ; program pointer is -42, ACI version 2.71.894, gtags (2039,36)

AGS cannot continue, this exception was fatal. Please note down the numbers above, remember what you were doing at the time and notify CJ on the Tech forum.



Most versions of Windows allow you to press Ctrl+C now to copy this entire message to the clipboard for easy reporting.
---------------------------
OK   
---------------------------


I take it I get a negative number because the room number has not been set at the point I am calling Debug, and that something is being done by AGS that uses that negative room number.

Here's my code from the global script that causes the crash:

function game_start() {
  // called when the game starts, before the first room is loaded
//TEMPORARY
Debug(3, 0);   //prompt for "skip to room..."
}


As this is clearly not the place to put a Debug command, where should I put it? If I put it in the "Player enters room (before fade-in)" section of the first room, typing the number of the first room will cause the Debug command to be run again, meaning I can't actually preview the game from the first room while that Debug command is there.
Title: Re: Crash on using Debug in global script
Post by: Rui 'Trovatore' Pires on Sun 27/05/2007 19:30:25
Actually, you'll probably find it more useful just to change the "[Player] Character Starts In Room" number.
Title: Re: Crash on using Debug in global script
Post by: GarageGothic on Sun 27/05/2007 19:54:51
Or just press Ctrl-X once the room has loaded.
Title: Re: Crash on using Debug in global script
Post by: Pumaman on Sun 27/05/2007 21:35:35
Yeah, you can't use that Debug command from within game_start. sorry, that should probably be documented.