Jump to content


Photo

Real Bug In Gm


  • This topic is locked This topic is locked
9 replies to this topic

#1 TALANTO

TALANTO

    GMC Member

  • GMC Member
  • 4 posts

Posted 24 March 2009 - 03:49 PM

Real bug in GM6.1 / GM6.1A / GM 7

show_message_ext('Answer the question is ','','2','3')

I can't select answer 1, but if I press vk_enter answer is 1.
  • 0

#2 ragarnak

ragarnak

    GMC Member

  • GMC Elder
  • 19468 posts
  • Version:GM8

Posted 24 March 2009 - 04:42 PM

I can't select answer 1, but if I press vk_enter answer is 1.

Not quite expected, but luckily not a game threatening flaw either. Just respond to either the 2 and 3 results as normal, and handle anything else as a 0 (ESCape pressed) result.

You did check for that ESCape, did you ? :)
  • 0

#3 Yourself

Yourself

    The Ultimate Pronoun

  • GMC Elder
  • 7352 posts
  • Version:Unknown

Posted 24 March 2009 - 04:47 PM

Why are you expecting bad input to a function to behave in a rational way? Granted GML does usually protect you from your own stupidity, but it's not something you should count on. I wouldn't really classify this as a bug because you're not using the function in an ordinary way.
  • 0

#4 hpapillon

hpapillon

    GMC Member

  • GMC Elder
  • 3020 posts
  • Version:Unknown

Posted 24 March 2009 - 09:02 PM

Why are you expecting bad input to a function to behave in a rational way? Granted GML does usually protect you from your own stupidity, but it's not something you should count on.


The particular example may be silly, but the problem isn't entirely frivolous. show_message_ext does *intentionally* allow you to omit buttons, after all, and therefore it should at least warn you in the help that a non-existent option can be selected if the player uses the keyboard rather than the mouse.

I was once using show_message_ext to navigate through a list of entries, and offering 'Previous' 'Done' 'Next' buttons at the bottom of the box, only displaying Previous and Next when there were earlier/later entries to go to. But when a beta-tester hit Enter on the popup for the first entry, it tried to find a previous entry and hit errors, even though there was no Previous button.

It's easily avoided if you know about it, but it's not documented! One would expect enter to default to the first visible button slot, not the button slot that doesn't exist.
  • 0
Yes, making games is my day job.
Anime Games
Gaming blog

#5 Tahnok

Tahnok

    Friendly Madman

  • GMC Member
  • 1854 posts
  • Version:GM:Studio

Posted 25 March 2009 - 01:26 AM

I guess this can be put in the same category as GM's rounding system. It's not really a bug per se, but it is counter-intuitive and not documented. A small note in the help file could no doubt alleviate some headaches.
  • 0

gmc_signature.png


#6 th15

th15

    GMC Member

  • GMC Member
  • 1585 posts
  • Version:Unknown

Posted 25 March 2009 - 02:50 AM

I think the issue is that the ENTER key always returns the value 1, the same way pressing ESCAPE during that dialog will return 0. It doesn't press a button per se but instead returns a specific value. I wouldn't call it a bug either, we're just expecting GML to do everything for us, which is something we take for granted a lot.

I suppose we can get around this by manually checking vk_enter when input for the function is received and therefore write a script to supercede the function that will return a specified default value instead of 1.
  • 0

Sean 'th15' Chan
site_logo.gif


#7 paul23

paul23

    GMC Member

  • Global Moderators
  • 4147 posts
  • Version:GM:Studio

Posted 25 March 2009 - 02:56 PM

I think the issue is that the ENTER key always returns the value 1, the same way pressing ESCAPE during that dialog will return 0. It doesn't press a button per se but instead returns a specific value. I wouldn't call it a bug either, we're just expecting GML to do everything for us, which is something we take for granted a lot.

I suppose we can get around this by manually checking vk_enter when input for the function is received and therefore write a script to supercede the function that will return a specified default value instead of 1.

Apart from that io_clear() is called after a show_message function: the key-states are always cleaned..
  • 0

#8 hpapillon

hpapillon

    GMC Member

  • GMC Elder
  • 3020 posts
  • Version:Unknown

Posted 25 March 2009 - 03:26 PM

I think the issue is that the ENTER key always returns the value 1, the same way pressing ESCAPE during that dialog will return 0. It doesn't press a button per se but instead returns a specific value.


People who like using keyboard control will expect windows popups to let them change buttons with Tab and select the chosen button with Enter.

... Of course, this is all the more reason for completely ignoring these builtin windows thingies and making your own anyway. :)
  • 0
Yes, making games is my day job.
Anime Games
Gaming blog

#9 uuf6429

uuf6429

    Covac Software

  • New Member
  • 2522 posts
  • Version:Unknown

Posted 25 March 2009 - 05:43 PM

Can't you (if knowing that the first button is empty) conditionally check for both 1 and 2 for the first visible option (ie, the second)?

GM has a lot of minor quirks like that, including extension handling in file selection dialogs. I wouldn't classify them as bugs, but in any case, they should still be well documented.

NB (Tahnok): On the other hand the precision problem *is* a bug, at least in my opinion.

(adding to hpapillon's; or use a prebuilt package of better stuff :))

Kind regards,
Chris.

Edited by uuf6429, 25 March 2009 - 05:44 PM.

  • 0

#10 Smarty

Smarty

    GMC Member

  • GMC Elder
  • 7522 posts
  • Version:GM:Studio

Posted 27 March 2009 - 12:34 PM

GM has a lot of minor quirks like that, including extension handling in file selection dialogs. I wouldn't classify them as bugs, but in any case, they should still be well documented.

One reason they're not documented is that a developer doesn't always anticipate all likely uses of the function. It takes users to fill those in. It's appropriate to assume that if you need less than the 3 keys available, you start out by specifying the required buttons first.

The most likely reason that answer one is selected is probably because the button is merely hidden, not removed, and because Windows usually accepts the ENTER key as pressing the first button in the dialog.
  • 0