Clickable List?
dellobenedetto
02 Jun 2016, 15:54I'm trying to make something where you talk to someone in a room and choose from a list of choices, after which a different script will occur depending on the selected choice. Something like this:
What's the best way to do this?
>Speak to Travel Guy
"Hey there! How do you want to travel?"
Car
Boat
Plane
>Car
"Sure thing! Eyes on the road!"
OR
>Boat
"Sure thing! Careful with the waves!"
OR
>Plane
"Sure thing! Have a nice flight!"
What's the best way to do this?
HegemonKhan
03 Jun 2016, 00:34for some Functions/Scripts, there's the 'popup window/get user typed-in input' and an in-line/text (clicking on hyperlink), for example:
http://docs.textadventures.co.uk/quest/ ... _menu.html
http://docs.textadventures.co.uk/quest/ ... wmenu.html
'show menu ()' vs 'ShowMenu ()'
you want to use the in-line/text (click on hyperlinks) Functions/Scripts and not the 'popup window/get user input' ones
------
and there's also the text processor commands that you can use too (for using/creating clickable hyperlinks):
http://docs.textadventures.co.uk/quest/ ... essor.html
------
but there's a bit more I think you got to do to implement what you want, but this is an initial starting point.
http://docs.textadventures.co.uk/quest/ ... _menu.html
http://docs.textadventures.co.uk/quest/ ... wmenu.html
'show menu ()' vs 'ShowMenu ()'
you want to use the in-line/text (click on hyperlinks) Functions/Scripts and not the 'popup window/get user input' ones
------
and there's also the text processor commands that you can use too (for using/creating clickable hyperlinks):
http://docs.textadventures.co.uk/quest/ ... essor.html
------
but there's a bit more I think you got to do to implement what you want, but this is an initial starting point.
dellobenedetto
03 Jun 2016, 13:44I tried following both the "show menu" and "ShowMenu" commands exactly, but neither of them actually compiled. Is there something I'm doing wrong?
The Pixie
03 Jun 2016, 14:17I think it is ShowMenu you want. Can you post the code you used? Go into the code view, and copy that).
HegemonKhan
04 Jun 2016, 00:52formatting/syntax:
(if you just did this 'ShowMenu()', that's my fault, I was lazy and didn't add in the parameters/arguments inside of the parenthesis)
using the 'split' Script/Function is a quick way to create a temporary/local List Attribute in this case, but there's other ways to create a permanent list, using either the 'split' Script/Function or other methods.
(if you just did this 'ShowMenu()', that's my fault, I was lazy and didn't add in the parameters/arguments inside of the parenthesis)
using the 'split' Script/Function is a quick way to create a temporary/local List Attribute in this case, but there's other ways to create a permanent list, using either the 'split' Script/Function or other methods.
ShowMenu ("your_message", split ("name_of_your_item1; name_of_your_item2; etc-etc-etc", ";"), false) {
// whatever Script(s)
}
dellobenedetto
09 Jun 2016, 15:36I used the code you presented and it worked, although all of the options led to the same script. Is there any way around that?
HegemonKhan
09 Jun 2016, 16:03you'll need to use an 'if' or 'switch' Script, for example, in code:
using an 'if' (if/else if/else) block (the 'if' Script/Function):
doing the 'if' Script in the GUI~Editor: run as script -> add new script -> 'scripts' Category/Section -> 'if' Script -> [expression] or whatever [blah] option
the 'show menu/ShowMenu' and 'get input' Scripts/Functions, automatically (hidden from you) sets your input/selection/choice to be stored into a built-in 'result' Variable
or, using the 'switch' Script/Function:
using an 'if' (if/else if/else) block (the 'if' Script/Function):
doing the 'if' Script in the GUI~Editor: run as script -> add new script -> 'scripts' Category/Section -> 'if' Script -> [expression] or whatever [blah] option
the 'show menu/ShowMenu' and 'get input' Scripts/Functions, automatically (hidden from you) sets your input/selection/choice to be stored into a built-in 'result' Variable
ShowMenu ("your_message", split ("name_of_your_item1; name_of_your_item2; etc-etc-etc", ";"), false) {
if (result = "name_of_your_item1") {
// whatever script(s)
} else if (result = "name_of_your_item2") {
// whatever script(s)
}
}
or, using the 'switch' Script/Function:
ShowMenu ("your_message", split ("name_of_your_item1; name_of_your_item2; etc-etc-etc", ";"), false) {
switch (result) {
case ("name_of_your_item1") {
// whatever script(s)
}
case ("name_of_your_item2") {
// whatever script(s)
}
}
}
Deckrect
12 Jun 2016, 06:08I am having a big trouble with these Text Processor commands. I have been running Quest version 5.6.2, but every time i try using {object:name} or {object:name:text} i only get a plain line and not a hyperlink to the desired object. I planned using this method to set decisions on my game, but it is not working and i guess i will have to be happy by using exists. i am using a Text Adventure masked as a Gamebook, by the way.