Making menus

jaydee
Ok still new to all this but gradually learning more:

Ok what do i need to do if i want to set up a menu at the opening of the game with options that can be selected, so for example :skip intro, Play intro etc...

what do I need to add in order to make it work?

lightwriter
A newbie way of doing this is is like this:

Ask (player.name + ", Would you be so kind to listen to my tale?") {
if (result = true) {
//code the intro if player wants to hear intro
}
else {
//code if player doesn't want to listen to intro
}

NOTE: player.name is just a reference to the character's name, it can be player.alias or doesn't have to be there at all?
You can have this instead:

Ask ("Do you want to hear the prologue?") {
if (result = true) {
//code the intro if player wants to hear intro
}
else {
//code if player doesn't want to listen to intro
}

HegemonKhan
here's links:

http://docs.textadventures.co.uk/quest/ ... ation.html (character creation)
http://docs.textadventures.co.uk/quest/ ... _menu.html (menu)
http://docs.textadventures.co.uk/quest/ ... witch.html ( ' switch ' Script)
http://docs.textadventures.co.uk/quest/ ... _case.html ( ' switch ' Script)
http://docs.textadventures.co.uk/quest/ ... tiple.html ( ' switch ' Script)

http://docs.textadventures.co.uk/quest/ ... _text.html (adding an introduction text)

lightwriter already mentioned about the 'ask' Script, but here's the documentation for it:

http://docs.textadventures.co.uk/quest/scripts/ask.html
http://docs.textadventures.co.uk/quest/ ... stion.html
^^^^^^^^^
http://docs.textadventures.co.uk/quest/guides/ (you can scroll down, for even more guides, easy to not realize this ~ easy to miss the guides that're further down)
http://docs.textadventures.co.uk/quest/tutorial/
^^^^^^^^
http://docs.textadventures.co.uk/quest/

jaydee
Ok thats a bit of help but i cant find much documentation on making a list for the question to reference to, I'm still a new user to this and coding, admittedly, is not my strongest point, if I wanted to create a multiple choice menu using the GUI and the games set options how would I set it up? Sorry I'm being a bit dense at the moment =P

The Pixie
Go to the Script tab of the game object; the bit at the top is the start Script. Click the seventh button, "code view", and paste this in:
list = Split("Skip intro;Play intro", ";")
show menu("Options", list, false) {
if (result = "Play intro") {
msg("In the beginning...")
}
}

You can then click the "Code view" button again to go back to normal view. Click Play and away you go.

This gives a pop-up menu. If you prefer an in-line menu, change "show menu" to "ShowMenu". Unfortunately, there is an issue with ShowMenu that means the room description will appear when the question is asked, rather than after the player has made a selection. Probably the best way to get around that is to have the player start in a blank room, and move her to the first room as part of this process.
list = Split("Skip intro;Play intro", ";")
ShowMenu("Options", list, false) {
if (result = "Play intro") {
msg("In the beginning...")
}
player.parent = start_room
}

If you want more options, add them like this:
list = Split("Skip intro;Play intro;Credits", ";")
ShowMenu("Options", list, false) {
if (result = "Play intro") {
msg("In the beginning...")
}
if (result = "Credits") {
msg("A big thanks to The Pixie!")
}
player.parent = start_room
}

This topic is now closed. Topics are closed after 60 days of inactivity.

Support

Forums