Jump to content


Photo

Show Question Action


  • Please log in to reply
3 replies to this topic

#1 Questioningorno

Questioningorno

    GMC Member

  • New Member
  • 621 posts

Posted 17 August 2009 - 10:53 PM

Okay, so I have a short little code that asks you a question and I want to know how to make more then just 2 options.
For instance, here's my code.

Mouse Left Button Pressed
if show_question("Save changes to "+string(global.fname))=1
{
 sleep=100
}
else
{
 room_restart()
}

Don't worry about sleep 100 it's just substituting until this is right. I want these answers: Yes, No, Cancel. After I figure that out how would I check all 3 answers? Because "else" wouldn't work because there are 3 options.

And 1 last thing. This is probably simple but how would I resume back to the program if "cancel" was clicked?


Thanks in advance.
  • 0

#2 2DLuis

2DLuis

    Graphic Designer

  • GMC Member
  • 2493 posts
  • Version:GM8

Posted 17 August 2009 - 11:03 PM

Do you want a GM message with three buttons?
If so, use the show_message_ext() function, and that will let you name your own buttons so you can have a button that says cancel and things like that.

EDIT:
For your smaller question on how to resume the game, don't do anything if it was clicked, GM will return back to its previous state

Edited by luis148, 17 August 2009 - 11:03 PM.

  • 0

#3 CoolGamrSms

CoolGamrSms

    Scorching Strings Maker

  • GMC Member
  • 1499 posts

Posted 17 August 2009 - 11:06 PM

var ind;
ind=show_message_ext("Save changes to "+string(global.fname),"Yes","No","Cancel");
switch(ind) {
case 0:
//The user hit escape, do what you would do for cancel
break;
case 1:
//The user hit Yes, save it and then end the game
break;
case 2:
//The user hit No, end the game
break;
case3:
//The user hit cancel
break;
}

Something like that should work.
  • 0

#4 Questioningorno

Questioningorno

    GMC Member

  • New Member
  • 621 posts

Posted 17 August 2009 - 11:41 PM

Thanks both of you.
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users