yah! this is a first, someone who actually is asking me (who wants) code to be given, haha (you're perfect for me and I for you, lol)
first, have you already seen this link (guide~help) ?? :
http://docs.textadventures.co.uk/quest/ ... ation.html(it's a step by step guide)
http://docs.textadventures.co.uk/quest/ ... _menu.htmlif you want to see my own struggle (I used, am using, quest to learn to code for my very first time, hehe) with learning quest and coding back 2-3 years when I first found out about quest and joined this site, hehe:
(at some number of posts into the thread, I am having trouble with 'show menu' ~ 'character creation', myself, asking for help)
viewtopic.php?t=3348------------
in the GUI~Editor :
run as script -> add a~new script -> output -> 'show a menu' Script -> (see below)
Menu text (your question or whatever message): blah
Menu List: use an existing list (Object_name.List_name, or this code-command: split ("option1; option2; option3; etc", ";")
allow player to cancel: self explanatory (able to go back on your choice: yes:true or no:false)
// automatically (hidden from you), the quest engine sets this: result = your_selected_choice
-> then, -> add a~new script -> (do whatever script, but see below)
for character creation menus, you'll want to choose this script:
-> then, -> add a~new script -> variables -> 'set a variable or attribute' Script -> (see below)
// conceptually (algebraic substitution): Object_name.Attribute_name = result = your_selected_choice -> Object_name.Attribute_name = your_selected_choice
Object_name.Attribute_name = result
examples:
player.gender_string = result
// ( I use 'gender_string' of my Attribute_name, because, this is my own personal labeling system, hehe, and because 'gender' and 'article' are already used for grammer: 'he~she~it' and 'him~her~them', and I don't want to over-write this default feature, which would happen if I used 'gender' for the Attribute_name)
player.race = result
player.class = result
in code, it looks like this:
// no existing list:
show menu ("What is your gender?, split ("male;female", ";"), false) {
// I would select 'male'
player.gender_string = result
msg ("You are a " + player.gender_string + ".")
// outputs: You are a male.
}
// an existing list (example is of creating~setting the list immediately before the 'show menu' script block runs, lol):
game.gender_stringlist = split ("male;female", ";")
show menu ("What is your gender?", game.gender_stringlist, false) {
// I would select 'male'
player.gender_string = result
msg ("You are a " + player.gender_string + ".")
// outputs: You are a male.
}
--------------
Coding:
Attributes:
Object_name.Attribute_name = Value_or_Expression
Examples:
String Attributes:
(the Value must have quotes, or for an Expression, the textual parts must have quotes)
player.gender_string = "female"
orc.gender = "male"
HK.gender_string = "male"
HK.hair_color = "dark brown"
HK.hair_color_string = "dark brown"
player.y = "x"
player.y_string = "1"
Static Expression:
HK.greeting = "Hi, my name is HK, what is your name?"
Dynamic Expression (I'll help you with these later, they're confusing unless you know the trick, hehe):
// player.alias = "HK"
// player.gender_string = "male"
// player.race = "human"
// player.class = "warrior"
player.appearance_description_string = player.alias + " is a " + player.gender_string + " " + player.race + " " + player.class + "."
// outputs: HK is a male human warrior.
// player.alias = "ilyena"
// player.gender_string = "female"
// player.race = "elf"
// player.class = "sorceress"
player.appearance_description_string = player.alias + " is a " + player.gender_string + " " + player.race + " " + player.class + "."
// outputs: ilyena is a female elf sorceress.
Integer (int) Attributes:
player.strength = 100
player.y = 5
Double (Float~Floating Point~Decimals):
player.strength = 19.482
Boolean Attributes:
orc.dead = false
orc.dead = true
player.flying = false
player.flying = true
Object Attributes:
(NO quotes on the Value)
player.right_hand = sword
player.left_hand = shield
List (Stringlist and Objectlist) Attributes:
HK.favorite_color_stringlist = split ("black;red", ";")
HK.toys_objectlist = split ("ball;computer_game;action_figures", ";")
etc Attribute Types (Dictionaries, and etc)
----------
i'm tired... see my other posts... I go into more detail on 'Attributes' ( ' set a variable or attribute ' Script) and the 'if' Script, the 2 SUPER Scripts for doing 90% of everything that you want to do in your game.