weezel wrote:But what I'm referring to is for a window to be presented, with a list of clickable options, which upon clicking would print a message or run a script. Any help at all would be much appreciated.
To make a MENU:
in the GUI~Editor:
Add a~new script -> Output -> show menu ->
show menu:
-> your question or whatever
-> your list of options~choices~selections*
-> can they cancel out of the menu?: true or false
In Code:
(old way)
http://quest5.net/wiki/Show_menu(new way, Jayne explains it above, as I still haven't worked with this in-line stuff yet)
http://quest5.net/wiki/ShowMenu*making a LIST:
the quick way (though, I think it is temporary, if you want your list to be permanent, then you'll have to make a permanent list):
http://quest5.net/wiki/Splitthe normal (longer way):
http://quest5.net/wiki/Using_Listshttp://quest5.net/wiki/NewStringListhttp://quest5.net/wiki/List_addhttp://quest5.net/wiki/ListCombinehttp://quest5.net/wiki/List_removeetc etc etc list stuff
Also, "switch" will likely be useful too:
http://quest5.net/wiki/Switchso for example, in code:
show menu ("your_question", your_list, true_or_false) {
your_label = result // quest will recognize "result" as the list choice that you've selected, so for this example, quest engine will recognize "result" as being your selection of "princess" (see below)
// whatever script using "result" (or the label that you set "result" to it), such as: msg ("the princess is very beautiful, so your mission is to rescue her, duh!") // however, this is missing the script that comes before the message (msg) script. see far below for an example in full.
}
the "split" way (temporary~local list):
<verb name="chat">
show menu ("What do you want to know about?", split ("king;sword;dragon;princess",";"), false) {
topic_choice = result
switch (topic_choice) {
case ("king") {
msg ("he's the king, you better rescue the princess, or you'll be executed.")
}
case ("sword") {
msg ("you'll need the legendary dragon slayer sword to kill the evil dragon.")
}
case ("dragon") {
msg ("The evil dragon has stolen the princess, the king has ordered you to rescue her from the beast.")
}
case ("princess") {
msg ("the princess is very beautiful, so your mission is to rescue her, duh!")
}
}
}
</verb>
the "normal" way (permanent~global list):
<global_events_object type="object">
<inherit name="editor_object" />
<topic_list type="simplestringlist">king</topic_list>
</global_events_object>
<verb name="chat">
firsttime {
game.topic_list = NewStringList ()
list add (global_events_object.topic_list, "sword")
list add (global_events_object.topic_list, "dragon")
list add (global_events_object.topic_list, "princess")
on ready {
show menu ("What do you want to know about?", global_events_object.topic_list, false) {
topic_choice = result
switch (topic_choice) {
case ("king") {
msg ("he's the king, you better rescue the princess, or you'll be executed.")
}
case ("sword") {
msg ("you'll need the legendary dragon slayer sword to kill the evil dragon.")
}
case ("dragon") {
msg ("The evil dragon has stolen the princess, the king has ordered you to rescue her from the beast.")
}
case ("princess") {
msg ("the princess is very beautiful, so your mission is to rescue her, so you can marry her, duh! And less importantly, if you don't, your life will be over, anyways.")
}
}
}
}
} otherwise {
show menu ("What do you want to know about?", split ("king;sword;dragon;princess",";"), false) {
topic_choice = result
switch (topic_choice) {
case ("king") {
msg ("he's the king, you better rescue the princess, or you'll be executed.")
}
case ("sword") {
msg ("you'll need the legendary dragon slayer sword to kill the evil dragon.")
}
case ("dragon") {
msg ("The evil dragon has stolen the princess, the king has ordered you to rescue her from the beast.")
}
case ("princess") {
msg ("the princess is very beautiful, so your mission is to rescue her, duh!")
}
}
}
}
</chat>