Jump to content


Photo

Writing a question.


  • Please log in to reply
8 replies to this topic

#1 DcoldSaviour77

DcoldSaviour77

    GMC Member

  • GMC Member
  • 255 posts
  • Version:GM8

Posted 11 March 2012 - 12:18 PM

Hi guys, I know the function to do this, I'm just not sure how to write the answers and the aftermath of picking a certain answer. So, I was wondering if someone can paste a simple question code for me to use as a guide.
Thanks!!!!

Edited by DcoldSaviour77, 11 March 2012 - 04:02 PM.

  • 0

#2 Artaex Media

Artaex Media

    Artaex Media

  • GMC Member
  • 1528 posts
  • Version:GM8

Posted 11 March 2012 - 12:25 PM

Then what function are you using?
  • 0

#3 filulilus

filulilus

    GMC Member

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

Posted 11 March 2012 - 12:48 PM

I'm ganna go ahead and guess that you use show_message_ext(str,but1,but2,but3)

The function returns a value between 0 and 3. 0 if <Esc> is pressed and 1 to 3 if any of the buttons are pressed.

You can use it like this:

value = show_message_ext("Choose a character!", "Mario", "Link", "Kirby")

if value = 0 show_message("You did not choose a character")
if value = 1 instance_create(0, 0, objMario)
if value = 2 instance_create(0, 0, objLink)
if value = 3 instance_create(0, 0, objKirby)

If you don't want to use any of the buttons you can just pass "" as a argument.

show_message_ext("Do you like to keep playing?", "YEAH!", "No thanks", "")

Edited by filulilus, 11 March 2012 - 12:51 PM.

  • 1

#4 DcoldSaviour77

DcoldSaviour77

    GMC Member

  • GMC Member
  • 255 posts
  • Version:GM8

Posted 11 March 2012 - 01:17 PM

I'm ganna go ahead and guess that you use show_message_ext(str,but1,but2,but3)

The function returns a value between 0 and 3. 0 if <Esc> is pressed and 1 to 3 if any of the buttons are pressed.

You can use it like this:

value = show_message_ext("Choose a character!", "Mario", "Link", "Kirby")

if value = 0 show_message("You did not choose a character")
if value = 1 instance_create(0, 0, objMario)
if value = 2 instance_create(0, 0, objLink)
if value = 3 instance_create(0, 0, objKirby)

If you don't want to use any of the buttons you can just pass "" as a argument.

show_message_ext("Do you like to keep playing?", "YEAH!", "No thanks", "")

Yes, that's just what I was trying to use. Thanks!!! Only three more tiny questions now. Will there always be a value of 0 and is it possible to change the buttons to choose a response? Does the player have hit the number 1,2,3,or 0 for a response?
  • 0

#5 filulilus

filulilus

    GMC Member

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

Posted 11 March 2012 - 02:02 PM

Yes, that's just what I was trying to use. Thanks!!! Only three more tiny questions now. Will there always be a value of 0 and is it possible to change the buttons to choose a response? Does the player have hit the number 1,2,3,or 0 for a response?

It will allways return a 0 if you press <Esc> but you can change it efter it's been returned.
if value = 0 value = 1

You meen key and not mouse presses?
Yeah, simply add a "&" infront of the number or letter you like to use.
show_message_ext('Text', '&Hello', '&1337', 'Hello &again')
button 1 will respond to "h"
button 2 will respond to "1"
button 3 will respond to "a"


P.S
You can find all this information in the Game maker manual which can be found in Game maker! :)
D.S

Edited by filulilus, 11 March 2012 - 02:04 PM.

  • 1

#6 DcoldSaviour77

DcoldSaviour77

    GMC Member

  • GMC Member
  • 255 posts
  • Version:GM8

Posted 11 March 2012 - 02:13 PM


Yes, that's just what I was trying to use. Thanks!!! Only three more tiny questions now. Will there always be a value of 0 and is it possible to change the buttons to choose a response? Does the player have hit the number 1,2,3,or 0 for a response?

It will allways return a 0 if you press <Esc> but you can change it efter it's been returned.
if value = 0 value = 1

You meen key and not mouse presses?
Yeah, simply add a "&" infront of the number or letter you like to use.
show_message_ext('Text', '&Hello', '&1337', 'Hello &again')
button 1 will respond to "h"
button 2 will respond to "1"
button 3 will respond to "a"


P.S
You can find all this information in the Game maker manual which can be found in Game maker! :)
D.S

Awsome!! Thanks a lot. I really appreciate your assistance!!! :biggrin:
  • 0

#7 DcoldSaviour77

DcoldSaviour77

    GMC Member

  • GMC Member
  • 255 posts
  • Version:GM8

Posted 11 March 2012 - 02:13 PM


Yes, that's just what I was trying to use. Thanks!!! Only three more tiny questions now. Will there always be a value of 0 and is it possible to change the buttons to choose a response? Does the player have hit the number 1,2,3,or 0 for a response?

It will allways return a 0 if you press <Esc> but you can change it efter it's been returned.
if value = 0 value = 1

You meen key and not mouse presses?
Yeah, simply add a "&" infront of the number or letter you like to use.
show_message_ext('Text', '&Hello', '&1337', 'Hello &again')
button 1 will respond to "h"
button 2 will respond to "1"
button 3 will respond to "a"


P.S
You can find all this information in the Game maker manual which can be found in Game maker! :)
D.S

Awsome!! Thanks a lot. I really appreciate your assistance!!! :biggrin:
  • 0

#8 DcoldSaviour77

DcoldSaviour77

    GMC Member

  • GMC Member
  • 255 posts
  • Version:GM8

Posted 11 March 2012 - 04:01 PM

I'm not trying to forum bump, but I have another question. I got the main part of it to work great, but my button responses are a tad bit long. I tried using message_button_size, but I couldn't get font to work. Is there any way to make the font fit inside the button or make the message box bigger with bigger buttons.
Thanks!!!
  • 0

#9 filulilus

filulilus

    GMC Member

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

Posted 11 March 2012 - 07:42 PM

You can make the buttons larger by using sprites, I don't know how large tho.

Make a sprite and call it something like sprMessageButton.

Then put:
message_button(sprMessageButton)
in the create event.

Edited by filulilus, 11 March 2012 - 07:42 PM.

  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users