illegal exception

Started by Gijs, Tue 04/01/2005 00:25:12

Previous topic - Next topic

Gijs

I was testing my game and when I pressed one of my GUI buttons to go to another room I got an error:

An exception 0xC0000005 occured in ACWIN.EXE at EIP =
0x7C910F29 ; program pointer is +200, ACI version 2.62.772,
gtags(12,2)

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



Normally it allways works when I press the button.   

strazer

Have you tried Gilbot's suggestion from this thread?

Gijs

I rebuild my room files but I still get the message.

strazer

Can you please post the contents of your interface_click function?

Gijs

here it is.

if (interface == GUI12) {
     if (button == 0) {
       NewRoom (7);

strazer

Hm, I suppose you've omitted the closing braces for posting here?
In that case, I'm afraid I'm out of ideas.

Gijs

that doesnt work either.
No!  :'(

Well I did make a back up two days ago so it isn't that bad...I hope

strazer

Just to clarify, your interface_click function looks like this, yes?

Code: ags
#sectionstart interface_click  // DO NOT EDIT OR REMOVE THIS LINE
function interface_click(int interface, int button) {

  if (interface == GUI12) {
     if (button == 0) {
       NewRoom (7);
     }
  }

}
#sectionend interface_click  // DO NOT EDIT OR REMOVE THIS LINE

Gijs

This is the whole thing
 
 
  if (interface == ICONBAR) {
    if (button == 4) {  // show inventory
      show_inventory_window();
    }
    else if (button == 5) {   // use selected inventory
      if (character[ GetPlayerCharacter() ].activeinv >= 0)
        SetCursorMode(4);
    }
    else if (button == 6)    // save game
      SaveGameDialog();
    else if (button == 7)   // load game
      RestoreGameDialog();
    else if (button == 8)   // quit
      QuitGame(1);
    else if (button == 9)    // about
      Display("Adventure Game Studio v2 run-time engine[[Copyright (c) 1999-2003 Chris Jones");
  }  // end if interface ICONBAR

  if (interface == INVENTORY) {
    // They clicked a button on the Inventory GUI
   
    if (button == 1) {
      // They pressed SELECT, so switch to the Get cursor
      SetCursorMode (MODE_USE);
      // But, override the appearance to look like the arrow
      SetMouseCursor (6);
    }
   
    if (button == 2) {
      // They pressed LOOK, so switch to that mode
      SetActiveInventory(-1);
      SetCursorMode(MODE_LOOK); 
    }
    if (button == 3) {
      // They pressed the OK button, close the GUI
      GUIOff (INVENTORY);
      SetDefaultCursor();
    }

    if ((button == 4) && (game.top_inv_item < game.num_inv_items - game.num_inv_displayed)) {
      // scroll down
      game.top_inv_item = game.top_inv_item + game.items_per_line;
    }
    if ((button == 5) && (game.top_inv_item > 0)){
      // scroll up
      game.top_inv_item = game.top_inv_item - game.items_per_line;
   
    }
  }

  if (interface == GUI3) {   
    if (button == 2) {
      GUIOn (6);
      GUIOff (18);
      GUIOff (5);
      GUIOff (7);
      GUIOff (3);
    }
    if (button == 0) {
      GUIOn (GUI18);
      GUIOff (6);
      GUIOff (5);
      GUIOff (7);
      GUIOff (3);
    }
    if (button == 3) {
      GUIOn (5);
      GUIOff (18);
      GUIOff (6);
      GUIOff (7);
      GUIOff (3);
    }
    if (button == 4) {
      GUIOn (7);
      GUIOff (3);
      GUIOff (5);
      GUIOff (6);
      GUIOff (18);
    }
    if (button == 5) {
      GUIOn (7);
      GUIOff (3);
      GUIOff (5);
      GUIOff (6);
      GUIOff (18);
    }
    if (button == 1) {
      GUIOn (3);
      GUIOff (5);
      GUIOff (6);
      GUIOff (7);
      GUIOff (18); 
 
    }
  }

   if (interface == GUI9) {
     if (button == 5) {
       GUIOff (7);
   
    }
  }
   if (interface == HELP) {
     if (button == 1) {
       GUIOff (HELP);
     }
     if (button == 6) {
       GUIOff (HELP);
       GUIOn (8);     
   
    }
  }

   if (interface == GUI8) {
     if (button == 1) {
       GUIOff (8);
       GUIOn (HELP);   

    }
  }
    if (interface == GUI18) {
      if (button == 2) {
        GUIOff (18);
   
    }
  }
   if (interface == GUI12) {
     if (button == 0) {
       NewRoom (7);
     }
     if (button == 1) {
       GUIOn (1); 
 
    }
  }
   if (interface==14) { 
SetMouseCursor(0);
   if (button==0) {
      // if save is pressed
      // Count saved games
      index=ListBoxGetNumItems(14,2); // Count saved games
      if (index<20) {
         GetTextBoxText(14,3,text); // Get the typed text
         GUIOff (14);
         SaveGameSlot(index,text); // Save game (text as description)
         
      }
      else { // if saved games are 20
         index=ListBoxGetSelected(14,2); // Get the selected save game
         GetTextBoxText(14,3,text); // Get the typed text
         
         SaveGameSlot(savegameindex[index],text); // Overwrite the selected game
     }
    ListBoxSaveGameList (14,2);   
    ListBoxSaveGameList (15,2);
   }

   if (button==1) {
      GUIOff (14);
   }

}
if (interface == 15) {

if (button == 0) {
index = ListBoxGetSelected(15,2);
RestoreGameSlot(savegameindex[index]);
  SetCursorMode(0);
GUIOff(15);
    }
  else if (button == 1) {
     GUIOff(15);
   
    }
  }
   if (interface == VOLUMEGUI) {
     if (button == 3) {
       SetCharacterSpeed (VIN, 1);
     }
     if (button == 4) {
       SetCharacterSpeed (VIN, 4);
     }
     if (button == 5) {
       SetCharacterSpeed (VIN, 10);   
     }
     if (button == 6) {
       SetMusicMasterVolume (50);
     }
     if (button == 7) {
       SetMusicMasterVolume (75);
     }
     if (button == 8) {
       SetMusicMasterVolume (100);
     }
     if (button == 9) {
       SetTalkingColor (VIN, 15);
     }
     if (button == 10) {
       SetTalkingColor (VIN, 1);
     }
     if (button == 11) {
       SetTalkingColor (VIN, 4);
     }
     if (button == 12) {
       SetTalkingColor (VIN, 2);
     }
     if (button == 14) {
       SetSoundVolume (25);
     }
     if (button == 15) {
       SetSoundVolume (50);
     }
     if (button == 16) {
       SetSoundVolume (100);       
     }
     if (button == 18) {
       SetSpeechFont (0);
     }
     if (button == 19) {
       SetSpeechFont (1);
     }
     if (button == 20) {
       SetSpeechFont (2);
     }
     if (button == 22) {
       SetGameSpeed (10);
     }
     if (button == 23) {
       SetGameSpeed (50);
     }
     if (button == 24) {
       SetGameSpeed (100);       
     }     
     if (button == 26) {
       SetScreenTransition (TRANSITION_FADE);
     }
     if (button == 27) {
       SetScreenTransition (TRANSITION_INSTANT);
     }
     if (button == 28) {
       SetScreenTransition (TRANSITION_DISSOLVE);   
     }
     if (button == 2) {
       GUIOff (VOLUMEGUI); 
   
    }
  }
     if (interface == GUI13) {
       if (button == 0) {
         QuitGame (0);
       }
       if (button == 1) {
         NewRoom (5);
       }
       if (button == 2) {
         GUIOff (13);     
    }
  }
  if (interface == GUI4) {
     if (button == 0) //    save game
       GUIOn (14);
     if (button == 1) //    load game
       GUIOn (15);
     if (button == 2)
       GUIOn (13);
     if (button == 3)        GUIOff (4);           
       GUIOff (3);
     if (button == 4) //    about
       Display ("A game by Gijs Dekker.");
    }
  }

Pumaman

Can you still load room 7 into the editor successfully?

Gijs

Yes I can still load room 7 into the editor.

Pumaman

Does this problem always happen when you click the button, or just sometimes?

Gijs

Normally it allways worked untill yesterday now I allways get the error.

Pumaman

Any chance you could upload the game so I can take a look?

Gijs

Well I'm working on my own website but it isn't done yet.
So I'm currently looking for a place to upload.

Pumaman

The other thing to try is grab a copy of 2.7 beta 9 from the beta thread, then make a backup copy of your game and try upgrading it to beta 9, and see if that fixes the problem. It's possible your bug is one that has already been fixed -- but as I say, make a backup copy of your game because upgrading to the beta will stop it working with 2.62.

Gijs

Ok I'll try it out as soon as possible.

SMF spam blocked by CleanTalk