Author Topic: Message Box error  (Read 7364 times)

Dr Obvious

  • Regular
  • **
  • Posts: 53
    • View Profile
    • http://www.drobvious.net
Message Box error
« on: 2005-09-14, 09:23:31 PM »
Whenever I have a message box in my game and I'm pressing more than one button or several direction buttons the game kicks me out with the following errors:

"Overflow" and "Error Playing Map: Display must be open to flip?"

Anyone have any idea why this might be happening?  It only happens when I have message mobes come up and no other time.  It's an easy problem to avoid I suppose if I tell the player to just not run around pressing a lot of button but I'd rather not do that! :p

Dr Obvious

  • Regular
  • **
  • Posts: 53
    • View Profile
    • http://www.drobvious.net
Message Box error
« Reply #1 on: 2005-09-15, 08:53:39 AM »
Just to clear things up a little, it seems to happen mainly if I'm pressing left (and right too I think) and punch cosntantly (though I haven't tested it with other buttons).

durnurd

  • Lead Lemming
  • Expert
  • Fanatic
  • *****
  • Posts: 1234
  • Games completed so far: 0
    • MSN Messenger - durnurd@hotmail.com
    • View Profile
    • Find My Ed
Message Box error
« Reply #2 on: 2005-09-15, 05:55:37 PM »
Take a look at the FAQ (link)

It tells you exactly why you are getting an overflow error.  The other error shows up simply because the first error showing up closed the display, so it can't draw on it any more.

Basically, the problem is probably because a sprite is too far off the map.
Edward Dassmesser

Dr Obvious

  • Regular
  • **
  • Posts: 53
    • View Profile
    • http://www.drobvious.net
Message Box error
« Reply #3 on: 2005-09-15, 06:47:59 PM »
Do you know why this might happen only when I open a message box and press left or right plus an action button?  I made sure to make the bottom of my map completely solid (several times bigger than the biggest sprite) and I'm not sure why this would only happen when I have a message box open and when I'm pressing a direction plus some button.

bluemonkmn

  • SGDK Author
  • Administrator
  • Fanatic
  • *****
  • Posts: 2761
    • ICQ Messenger - 2678251
    • MSN Messenger - BlueMonkMN@gmail.com
    • View Profile
    • http://sgdk2.sf.net/
    • Email
Message Box error
« Reply #4 on: 2005-09-15, 08:45:43 PM »
I can't imagine -- unless it has something to do with your script -- have you tried doing it with your script detached?  Does it happen with just any message box?  If you push the same combination after the message box is closed the error doesn't happen?

Dr Obvious

  • Regular
  • **
  • Posts: 53
    • View Profile
    • http://www.drobvious.net
Message Box error
« Reply #5 on: 2005-09-15, 09:33:00 PM »
I can make it happen with and without the script and only happens when I'm closing the message box.  The same thing is happening in every level and only with message boxes.  I can run around my levels pushing any combination of buttons but nothing really happens.

Is there by chance just a way to pause the game like the message box does?  I actually don't need the message boxes, I just really need the action in the game paused so I can bring a sprite that happens to be playing the part of a message box.

To clarify what I'm doing(and I actually haven't managed to get an error on this method), I'm making a function that calls creates a sprite near the player, makes two message boxes, and then deletes that sprite.  The sprite that it creates is a message box made in photoshop with a special font and a potrait of the character talking.  The two message boxes I make are actually dummy message boxes with a font and font size set with text but all line breaks removed so that it doesn't write anything on the screen but the game action is still paused.  If I could just pause the game, I could completely get rid of the message boxes completely and not even worry about this problem (and I would rather use some sort of pause rather than doing that).

I haven't gotton an error with the two message box way of doing things, but I haven't really tried very hard getting an error there.  I don't think I have any sprites falling way off the screen, the only initial instances I have are my player sprite and my HUD sprites which don't go anywhere.  Everything else is drawn or erased at various points depending on where the player is.


-edit-
If there isn't some sort of pause function, would there be a way to do something like just set my frame rate to 1 and then set it back to 60 when the player presses a button?

billybob884

  • Contributor
  • Fanatic
  • **
  • Posts: 355
    • AOL Instant Messenger - billybob884
    • View Profile
Message Box error
« Reply #6 on: 2005-09-16, 09:00:05 AM »
mm if hte frame rate was 1, the game would still be playing, wouldnt it? itd have to be 0
but there are 2 options for a pause feature,
1 have a message box come up that says PAUSE in it (when a message box is displayed, it pauses all gameplay)
or 2, have a function that switches to another map, but make sure the remember old map is checked, then on the other map have a function that switches back to <old map>
"In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move." :: Hitchhiker's Guide to the Galaxy

durnurd

  • Lead Lemming
  • Expert
  • Fanatic
  • *****
  • Posts: 1234
  • Games completed so far: 0
    • MSN Messenger - durnurd@hotmail.com
    • View Profile
    • Find My Ed
Message Box error
« Reply #7 on: 2005-09-16, 10:22:18 AM »
I think that what he wants here is to be able to display something on the map while paused, so changing maps isn't really an option.  And I think he already is doing number one, but an error is occuring.

Another way to make it pause is to play a modal sound.  Either a silent wav file that's maybe five seconds long (but you couldn't interrupt it then, so it would always be five seconds) or a wav file for each line of dialog.
Edward Dassmesser

bluemonkmn

  • SGDK Author
  • Administrator
  • Fanatic
  • *****
  • Posts: 2761
    • ICQ Messenger - 2678251
    • MSN Messenger - BlueMonkMN@gmail.com
    • View Profile
    • http://sgdk2.sf.net/
    • Email
Pausing
« Reply #8 on: 2005-09-16, 12:37:42 PM »
If you can reproduce the problem in a simple project I'd like to see it (email it to me).  I can't imagine why you would be getitng an overflow on a messagebox if you aren't even running script.

I think you might be able to use the sound to pause the game as durnurd suggested -- maybe you can tell it to loop too, and then it might play until you hit a button.  I don't remember the details of how sound options work right now and I don't have GameDev handy at the moment.

Otherwise, remind me to check the scripting reference when I get home (reply to this thread so I remember to read this stuff again).  I think there was a bPaused switch on the player, but it may not have been visible to script.

Dr Obvious

  • Regular
  • **
  • Posts: 53
    • View Profile
    • http://www.drobvious.net
Message Box error
« Reply #9 on: 2005-09-16, 01:24:32 PM »
The sound thing sounds interesting.  Would I just start a blank sound and have it loop until any button is pressed?  How would I do that if I already have all my button used up?  Probably doesn't matter since that would be a last resort, but good to know I could at least do something like that if I can't fixthe message box thing by Sunday...

durnurd

  • Lead Lemming
  • Expert
  • Fanatic
  • *****
  • Posts: 1234
  • Games completed so far: 0
    • MSN Messenger - durnurd@hotmail.com
    • View Profile
    • Find My Ed
Message Box error
« Reply #10 on: 2005-09-16, 02:18:22 PM »
Well, no, it wouldn't loop until a button is pressed.  It would play once then stop.  So it would not be a controllable length (see my previous message).  If you had it loop and modal at the same time, it would never stop.
Edward Dassmesser

bluemonkmn

  • SGDK Author
  • Administrator
  • Fanatic
  • *****
  • Posts: 2761
    • ICQ Messenger - 2678251
    • MSN Messenger - BlueMonkMN@gmail.com
    • View Profile
    • http://sgdk2.sf.net/
    • Email
Message Box error
« Reply #11 on: 2005-09-16, 05:52:15 PM »
I found a method that *should* work, but it doesn't.  You should be able to set the bSplashShowing property of the Project opbject to true and then call ProjectObj.WaitForSplash from inside your script.  Then in the OnControllerChanged event, you should be able to set ProjectObj.bSplashShowing to False to un-pause it.  But setting it to False surprisingly has no effect even though I can see that the event is firing and it's getting set to false.  So I've looked and looked, and I think you may have to go with the message box solution.  (I confirmed that sound clips don't loop when they're modal, unfortunately, even though they do stop if you press a button.)

So you weren't able to use the messagebox background graphic to adequately convey the graphics you wanted to show?

Dr Obvious

  • Regular
  • **
  • Posts: 53
    • View Profile
    • http://www.drobvious.net
Message Box error
« Reply #12 on: 2005-09-16, 09:25:21 PM »
It's a little bit of that (I probably could, I would just have to format the text to be the right space from the edge) and I also want the boxes on various parts of the screen.

durnurd

  • Lead Lemming
  • Expert
  • Fanatic
  • *****
  • Posts: 1234
  • Games completed so far: 0
    • MSN Messenger - durnurd@hotmail.com
    • View Profile
    • Find My Ed
Message Box error
« Reply #13 on: 2005-09-17, 08:18:58 AM »
There is the option of having like a minute-long sound clip, which if compressed to the lowest setting (since you don't care what quality a silent clip is) only takes about 60 KM unzipped and less than 1KB zipped.
Edward Dassmesser

bluemonkmn

  • SGDK Author
  • Administrator
  • Fanatic
  • *****
  • Posts: 2761
    • ICQ Messenger - 2678251
    • MSN Messenger - BlueMonkMN@gmail.com
    • View Profile
    • http://sgdk2.sf.net/
    • Email
Message Box error
« Reply #14 on: 2005-09-17, 04:51:07 PM »
That silent fabric must be pretty slick if you can zip 60 kilometers of the stuff into 1 kilobyte! ;)