there's a lot of ways to do this, but it's the same design:
0. plug this stuff into a default or created "talk" verb or command script, or you could use the game player~user 's input via "get input", too.
1. give a list of choices (or don't, as this is optional obviously)
2. if this choice,
3. then do whatever script
msg ("What do you want to talk about?")
msg ("Type 1 for sword, 2 for evil_sorcerer, or 3 for princess")
get input {
game.topic=result
switch (game.topic) {
case ("1") {
msg ("Sword_info")
}
case ("2") {
msg ("Evil_sorcerer_info")
}
case ("3") {
msg ("Princess_info")
} else {
msg ("That's not a topic, please select one of the defined numbers provided to you: 1 for sword, 2 for evil_sorcerer, or 3 for princess)
}
}
}
or
show menu ("your_message", split ("choice_1; choice_2; choice_3", ";"), false_or_true ~ for canceling_ie_going_back) {
game.topics=result
switch (game.topics) {
case ("choice_1") {
do whatever script
}
case ("choice_2") {
do whatever script
}
case ("choice_3") {
do whatever script
}
}
}
"split" creates a quick local (temporary) list, if you want a global (permanent) list, then you got to create one, and then plug in its name into where the "split" is in the above example.
you can also use dictionaries too, though it gets a bit more confusing.
also, if you want more complex dialogue (such as one dialogue topic requiring another dialogue topic), you'll have to use the same method, create a flag (boolean attribute), such as "sword_topic_viewed=true", and then use "if" for the conditional, such as "case ("orc") { -> if (sword_topic_viewed=true), then msg ("Use the sword to kill the orc"). I can explain this better, if you're interested, as this isn't that clear, as I was just being brief about it.
Also, if you don't want topics to be available until they're suppose to be, then I can explain how to do that as well (basically, it just involves adding topics to the list, when the requirements have been met, and etc like stuff).
here's some references for you:
http://quest5.net/wiki/Category:All_Fun ... t_Commandshttp://quest5.net/wiki/Using_Listshttp://quest5.net/wiki/Using_Dictionarieshttp://quest5.net/wiki/Show_menuhttp://quest5.net/wiki/Switchhttp://quest5.net/wiki/Get_input (you could use this if you want to use the game player~user 's input)
http://quest5.net/wiki/Conversationshttp://quest5.net/wiki/Dynamic_Menus_for_Conversationshttp://quest5.net/wiki/Hs-multiplehttp://quest5.net/wiki/Hs-asktellhttp://quest5.net/wiki/Hs-addingquestion1and here's some conversation testing game stuff for you to look at:
(you'll need to convert it to v5.4, as this is for v5.3, ask someone to help you do the converting, if you need it)
<!--Saved by Quest 5.3.4762.29157-->
<asl version="530">
<include ref="English.aslx" />
<include ref="Core.aslx" />
<game name="Testing Game Stuff">
<gameid>d83ba5bb-2e3c-4f31-80c9-3e88a2dc082c</gameid>
<version>1.0</version>
<turns type="int">0</turns>
<statusattributes type="stringdictionary">turns = </statusattributes>
<hint_list type="list">null_hint</hint_list>
<autodisplayverbs type="boolean">false</autodisplayverbs>
<pov type="object">player</pov>
<start type="script">
character_creation
</start>
<hint_dict type="scriptdictionary">
<item key="doormat_hint">
msg ("Try to pull the doormat. Type in: pull doormat")
</item>
</hint_dict>
</game>
<object name="homeyard">
<inherit name="editor_room" />
<object name="player">
<inherit name="defaultplayer" />
<inherit name="editor_player" />
<drop type="boolean">false</drop>
<displayverbs>Look at</displayverbs>
<inventoryverbs>Look at; Use; Drop</inventoryverbs>
</object>
<object name="guide">
<inherit name="editor_object" />
<drop type="boolean">false</drop>
<displayverbs>Look at; Hint</displayverbs>
<inventoryverbs>Look at; Use; Drop</inventoryverbs>
<hint type="script">
show menu ("Hint about what?", game.hint_list, false) {
switch (result) {
case ("null_hint") {
msg ("No hints are available")
}
case ("doormat_hint") {
msg (ScriptDictionaryItem (game.hint_dict,"doormat_hint"))
}
}
}
</hint>
</object>
<exit name="to_frontyard" to="frontyard" />
</object>
<object name="frontyard">
<inherit name="editor_room" />
<object name="doormat">
<inherit name="editor_object" />
<drop type="boolean">false</drop>
<displayverbs>Look at</displayverbs>
<pull type="script">
MakeObjectVisible (frontdoorkey)
msg ("You found a key under the doormat")
</pull>
<look type="script">
list add (game.hint_list, "doormat_hint")
msg ("Your guide has a new hint for you now")
</look>
</object>
<object name="frontdoorkey">
<inherit name="editor_object" />
<alias>key</alias>
<drop />
<take />
<visible type="boolean">false</visible>
</object>
<exit name="to_homeyard" to="homeyard" />
</object>
<turnscript name="game_turns">
<enabled />
<script>
if (frontdoorkey.parent = player) {
msg ("You've won the game!")
finish
}
game.turns = game.turns + 1
</script>
</turnscript>
<verb>
<property>hint</property>
<pattern>hint</pattern>
<defaultexpression>"You can't hint " + object.article + "."</defaultexpression>
</verb>
<function name="character_creation">
msg ("What is your name?")
get input {
player.alias = result
msg (" - " + player.alias)
show menu ("What is your gender?", split ("male;female",";"), false) {
player.gender = result
show menu ("What is your race?", split ("american;european;african;asian",";"), false) {
player.race = result
show menu ("What is your eye color?", split ("blue;green;hazel;amber;brown",";"), false) {
player.eye_color = result
show menu ("What is your hair color?", split ("yellow;orange;red;brown;black;grey;white",";"), false) {
player.hair_color = result
show menu ("What is your skin color?", split ("white;light;tan;dark;red;brown;black",";"), false) {
player.skin_color = result
show menu ("What is your maturity?", split ("adult;teen;child",";"), false) {
player.maturity = result
msg ("What is your age?")
get input {
player.age = result
msg (" - " + player.age)
msg (player.alias + " is a " + player.age + " year old " + player.gender + " " + player.race + " " + player.maturity + " with " + player.eye_color + " eyes, " + player.hair_color + " hair, and " + player.skin_color +" skin.")
wait {
ClearScreen
}
}
}
}
}
}
}
}
}
</function>
</asl>
<asl version="530">
<include ref="English.aslx" />
<include ref="Core.aslx" />
<game name="NPC Crowd">
<gameid>70d76bbb-2e9b-455e-a69e-b79f47955343</gameid>
<version>1.0</version>
<firstpublished>2013</firstpublished>
<turns type="int">0</turns>
<statusattributes type="stringdictionary">turns = </statusattributes>
</game>
<object name="room">
<inherit name="editor_room" />
<object name="player">
<inherit name="editor_object" />
<inherit name="editor_player" />
<drop type="boolean">false</drop>
</object>
<object name="locked_door">
<inherit name="editor_object" />
<drop type="boolean">false</drop>
<knock type="script">
if (NPC_Crowd.parent = locked_room) {
msg ("You hear a voice call out, \"Give me a moment! I'll be right out!\" from behind the door.")
}
else if (NPC_Crowd.parent = room) {
msg ("Nobody answers.")
}
</knock>
</object>
<object name="NPC_Crowd">
<inherit name="editor_object" />
<alias>crowd</alias>
<behaviorDesc type="list">A dusty old tome.; It's a weathered volume.; A very old book with that familiar musty book smell.</behaviorDesc>
<drop type="boolean">false</drop>
<speak type="script">
msg (StringListItem(NPC_Crowd.behaviorDesc, GetRandomInt(1,3) - 1))
</speak>
</object>
</object>
<object name="locked_room">
<inherit name="editor_room" />
</object>
<turnscript>
<enabled />
<script>
SetTurnTimeout (5) {
if (NPC_Crowd.parent = room) {
MoveObject (NPC_Crowd, locked_room)
}
else if (NPC_Crowd.parent = locked_room) {
MoveObject (NPC_Crowd, room)
}
}
</script>
</turnscript>
</asl>
<asl version="530">
<include ref="English.aslx" />
<include ref="Core.aslx" />
<game name="StringDicTest">
<gameid>490059fa-4154-4263-afa3-33dab1095527</gameid>
<version>1.0</version>
<firstpublished>2013</firstpublished>
</game>
<object name="room">
<inherit name="editor_room" />
<object name="player">
<inherit name="editor_object" />
<inherit name="editor_player" />
</object>
<object name="npc">
<inherit name="editor_object" />
<conversation type="stringdictionary">1 = A;2 = B;3 = C</conversation>
<speak type="script">
invoke (StringDictionaryItem (this.conversation , ToString (GetRandomInt (1,3))))
</speak>
</object>
</object>
</asl>
this is really old, using v5.2 lol:
<asl version="520">
<include ref="English.aslx" />
<include ref="Core.aslx" />
<game name="Testing Game Stuff">
<gameid>cd102f9d-370a-4bda-b6ea-ca42288f619c</gameid>
<version>1.0</version>
<start type="script">
question1
</start>
</game>
<object name="room">
<inherit name="editor_room" />
<object name="player">
<inherit name="defaultplayer" />
<answer1>HK</answer1>
</object>
</object>
<function name="question1">
msg ("To proceed, you must answer the question correctly")
msg ("What is my name? Answer: HK")
get input {
msg (result)
if (player.answer1 = result) {
msg ("You got the answer right, you may proceed")
}
else {
msg ("Wrong answer, try again")
question1
}
}
</function>
</asl>