Illegal exception

Started by He-Man, Mon 21/06/2004 01:53:37

Previous topic - Next topic

He-Man

Hi I was just testing my game.
I'm using a monkey Island II template. Everytime I press the F5 key to get the save/load menu AGS gives me this message:

---------------------------
Illegal exception
---------------------------
An exception 0xC0000005 occured in ACWIN.EXE at EIP = 0x0041DF0A ; program pointer is +333, ACI version 2.60.698, gtags (2,11)

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.

I'm pretty new to AGS but I guess I'd better do what the message say, so here you are...


Gilbert

Can you post the portion of script about launching the GUI (I think it should be in on_key_pressed() function of the global script)?

Also make sure that you're GUIs don't use any non-existing sprites (like you deleted some of them for example).

He-Man

#2
Thanks for the fast reply!

The game crashes everytime I call any of the GUIs. (by pressing SPACEBAR,F8, etc.)

I tried a couple of things and I have figured out that the game crash every time I call a GUI set to PopUp Modal!

Here's the entire script for on_key:

/**/function on_key_press(int keycode) {///////////////////////////////////////On Key Press/////////////////On Key Press
/**/Ã,  // called when a key is pressed. keycode holds the key's ASCII code
Ã,  if (keycode==32){// SPACEBAR
Ã,  Ã,  Ã,  if (IsGamePaused()==0){
Ã,  Ã,  Ã,  Ã,  Ã, GUIOn(PAUSED);
Ã,  Ã,  Ã,  Ã,  Ã, DisableInterface();
Ã,  Ã,  Ã,  }
Ã,  Ã,  Ã,  else{
Ã,  Ã,  Ã,  Ã,  Ã, GUIOff(PAUSED);
Ã,  Ã,  Ã,  Ã,  Ã, EnableInterface();
Ã,  Ã,  Ã,  }
Ã,  Ã,  }
Ã,  if (IsGUIOn(CONFIRMEXIT)==1){ // if exit gui is on
Ã,  Ã,  Ã, if (keycode == 78) GUIOff(CONFIRMEXIT);//if N is pressed continue
Ã,  Ã,  Ã, if (keycode == 89) QuitGame(0);//if Y is pressed quit game
Ã,  Ã,  Ã,  Ã,  }
Ã,  if (IsGUIOn(RESTART)==1){ // if exit gui is on
Ã,  Ã,  Ã, if (keycode == 78) GUIOff(RESTART);//if N is pressed continue
Ã,  Ã,  Ã, if (keycode == 89) RestartGame();//if Y is pressed quit game
Ã,  Ã,  Ã,  Ã,  }
Ã,  if (IsGamePaused() == 1) keycode=0;Ã,  // game paused, so don't react to keypresses
Ã,  if (keycode==359) Display("Adventure Game Studio v2 run-time engine[[Copyright (c) 1999-2003 Chris Jones[[SCUMM template by Proskrito :)");// F1
Ã,  if (keycode==363) GUIOn(OPTIONS);Ã,  Ã, // F5 - OPTIONS
Ã,  if (keycode==366) GUIOn(RESTART);Ã,  // F8 - RESTART
Ã,  if (keycode==434) SaveScreenShot("scrnshot.bmp");Ã,  // F12
Ã,  if (keycode==19)Ã,  Debug(0,0);Ã,  // Ctrl-S, give all inventory
Ã,  if (keycode==22)Ã,  Debug(1,0);Ã,  // Ctrl-V, version
Ã,  if (keycode==1)Ã,  Ã, Debug(2,0);Ã,  // Ctrl-A, show walkable areas
Ã,  if (keycode==24)Ã,  Debug(3,0);Ã,  // Ctrl-X, teleport to room
Ã,  // triggering actions by the keys:
Ã,  if (Translation("none")){// if no translation file is being used
Ã,  Ã,  if (keycode == 71)Ã,  SetMode("give");Ã,  Ã,  Ã, //G
Ã,  Ã,  if (keycode == 80)Ã,  SetMode("pick up");Ã,  //P
Ã,  Ã,  if (keycode == 85)Ã,  SetMode("use");Ã,  Ã,  Ã,  //U
Ã,  Ã,  if (keycode == 79)Ã,  SetMode("open");Ã,  Ã,  Ã, //O
Ã,  Ã,  if (keycode == 84)Ã,  SetMode("talk to");Ã,  //T
Ã,  Ã,  if (keycode == 83)Ã,  SetMode("push");Ã,  Ã,  Ã, //S
Ã,  Ã,  if (keycode == 67)Ã,  SetMode("close");Ã,  Ã,  //C
Ã,  Ã,  if (keycode == 76)Ã,  SetMode("look at");Ã,  //L
Ã,  Ã,  if (keycode == 89)Ã,  SetMode("pull");Ã,  Ã,  Ã, //Y
Ã,  }
/**/}

Gilbert

Seems to be okay, I think you have to check if there're a missing button sprite, etc.

Pumaman

hmm, looks like a crash rendering the character graphics - though why this would happen when you turn the GUI on, I don't know.

Could you upload the game for me to take a look at?

SMF spam blocked by CleanTalk