Crash on using Debug in global script

Started by paolo, Sun 27/05/2007 19:21:45

Previous topic - Next topic

paolo

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.

Rui 'Trovatore' Pires

Actually, you'll probably find it more useful just to change the "[Player] Character Starts In Room" number.
Reach for the moon. Even if you miss, you'll land among the stars.

Kneel. Now.

Never throw chicken at a Leprechaun.

GarageGothic

Or just press Ctrl-X once the room has loaded.

Pumaman

Yeah, you can't use that Debug command from within game_start. sorry, that should probably be documented.

SMF spam blocked by CleanTalk