Illegal exception[SOLVED]

Started by Vincent, Wed 23/08/2017 01:15:35

Previous topic - Next topic

Vincent

#20
I was confident that everything would go well but unfortunately I get the same error (or almost).
I notice that this time the error it's slightly different from the first one that I got a couple of days ago.

This is how the newest error looks like:
An exception 0xC0000005 occured in ACWIN.EXE at EIP = 0x70441082 ; program pointer is +2051, ACI version 3.21.1115, gtags (123,2)

And the old one was like this:
An exception 0xC0000005 occured in ACWIN.EXE at EIP = 0x62151082 ; program pointer is +2051, ACI version 3.21.1115, gtags (123,2)


:EDIT:
I have done this process once again and I get another different error!? (not sure if it is important or not?!)
An exception 0xC0000005 occured in ACWIN.EXE at EIP = 0x6F8B18B0 ; program pointer is +2051, ACI version 3.21.1115, gtags (123,2)

Monsieur OUXX

Do you still get the error when you restore a saved game while there is no joystick plugged?

If yes, then, while Wyz might be working on it (you're a lucky AGSer having a plugin author look specifically into your issue! ;) ), you can extremely easily do what was suggested earlier, both by the plugin's manual (even though not explained in detail) and by Crimson Wizard: just before calling the RestoreSavedGame, check if there is a joystick plugged. If not, then display a message and do not call RestoreSavedGame
 

Vincent

#22
Quote from: Monsieur OUXX on Sat 26/08/2017 15:45:16
Do you still get the error when you restore a saved game while there is no joystick plugged?

Yes, I have just done to test this, what do you think I've tried until now?! :)

Quote from: Monsieur OUXX on Sat 26/08/2017 15:45:16
If yes, then, while Wyz might be working on it (you're a lucky AGSer having a plugin author look specifically into your issue! ;) ), you can extremely easily do what was suggested earlier, both by the plugin's manual (even though not explained in detail) and by Crimson Wizard: just before calling the RestoreSavedGame, check if there is a joystick plugged. If not, then display a message and do not call RestoreSavedGame

Yes, you are right, I feel much lucky about this indeed!
I can not thank enough Wyz that he's giving me an help on this issue, really.
About what CW and Snarky suggest before it's just fine but I really would like to avoid this (if possible).
I mean if a joystick it's not plugged anymore (in a previous savestate that it was plugged in) then the plugin should turn off or something alike to prevent this issue and the game will keep running normally (not sure if this is possible at the moment, it sound like a twisted logic of mine).

Wyz

Ok, I finally got round to test this myself and good news: I was able to replicate the error. I should be able to fix this relatively easy. ;-D

You should probably still do something when the game is restored (using on_event). When the game is restored and the plugin misses it, it will be marked invalid. You can test this by checking the Valid function. A good moment to reset the input configuration, or inform the player, or something.

I'll keep you posted. :)
Life is like an adventure without the pixel hunts.

Vincent

#24
Fantastic, I am really much HAPPY to hear this news from you! :)
It's ok about using extra check like the valid function, maybe it should be something like this?
Code: ags

function on_event (EventType event, int data) 
{
  if (event == eEventRestoreGame)
  {
    if (joy == null || (!joy.Valid()))
    {
      // do stuff
    }
  }
}


Most likely however, there will need something else in the code that will have to do with your updates in the plugin I guess. I am not sure about this, but it would be amazing if you could even show me a safe way to use a code in the function on_event? That's just to be to the safe side.

Best regards!

Wyz

Well, the plug-in should never crash the game when restoring a save game that has a different joystick setup; when that happens you can consider that a bug in the plug-in, and then please let me know. When a Joystick object you made becomes invalid for whatever reason, it is replaced with a dummy object that acts like a joystick but is frozen in time. However I recommend the check to make sure the players aren't confused about the situation.
For instance when you have a single joystick setup and you let the game find (or players pick) one at the start of the game; when the players restore a game and have inadvertently changed their joystick setup you'll want to repeat this bit. If you have a game where the joystick use is optional and players have to select it in a menu or something, you'll want to show them a warning things changed and they may want to reconfigure it.
Of course I'm not telling you how to build your game, but since this matter came up, I thought I'll just give you the tip. :-D

So I think I've fixed it now. :) You can download it here (temporarily). Let me know if it works. ;-D

Btw, special thanks go to CW for suggesting to use a virtual joystick in the other thread; that really sped things up, as I didn't have to crawl through the attic opening lots of boxes, trying to find my gamepad. Thanks! :-D
Life is like an adventure without the pixel hunts.

Vincent

#26
Okay, I think I understand everything and I will try to keep these info in mind!
So... I have downloaded this newest version of the plugin and...
DEAR LORD, THIS IS WORKING LIKE A CHARM NOW!!! :-D
I really can't believe the hardest work you have done here and the time you spent to fix this issue! :)
Still thank you very much, I really much appreciated your help once again!!! :)

SMF spam blocked by CleanTalk