Help With Dynamic Menus For Conversations

TextStories
http://docs.textadventures.co.uk/quest/ ... tions.html

Ok, so far I have an object called “Mother”, who is a named female. I finally worked out how to start a topic and also how to hide it after it has been seen, so it wont show it again. For obvious reasons I would not want to say “good morning” more than once and do the whole sequence of events as shown below again. However, I am not sure how to do a regular Conversation Topic nor even a Greeting Script, which the latter would be the “good morning” circle of events to begin with.

Now I can have both “good morning” and “where is father” Starter Conversation Topics and they both work, but “where is father” I want as just a regular Conversation Topic. At present all that occurs when used as a Conversation Topic, is that-

"> speak to mother
You don't really have anything to say to mother right now.", which is quite the opposite of what I want.

How do I go about fixing this? In other words I want it to pop up after the “good morning” one is clicked and gone for the rest of the game. I have tried to follow the directions as close as possible, but I am just not getting it, although last night I could not even get this far... I even tried to download the sample ConvDemo.aslx and then run it in Quest as a separate game, but it gives me error messages... perhaps not compatible with the newest update of Quest?

And I think I am stuck at- “By default topic will disappear after the player has seen them. To stop that, untick the "Automatically hide after showing" box. You can have new topics appear in the menu after the player has seen this one. Add the name (not the alias) to the list. This can be a topic for another character, by the way.”

Add the “name” (not the alias) to what “list” exactly? Here is the conversation I am trying to get to work properly.

> speak to mother
Talk to mother about...
- mother_goodmorning
You rush up to greet her with a cheerful, "Good morning mother!".
"Good morning my Dear!", she replies with the same enthusiasm. "Sleep well?", she asks as she pulls you onto her lap holding you tightly and moves the wandering blond hairs from your sparkling blue eyes.
You smile and nod, telling a little white lie and she smiles back unknowingly, letting you go as you slide back to the plush carpet, before she resumes what she was doing previously.



> speak to mother
Talk to mother about...
- mother_have_you_seen_father
"Have you seen papa?", you ask, although you are sure he is around some where, but where is the question.
You mother looks up briefly from writing, "He should be in the Meeting Hall discussing today's events..."
"What events?", you ask curiously.
Your mother speaks to you while still engaging in her writing. You are wondering what it is she is actually writing about. You mother has such pretty calligraphy... "We are having a visitor from a far off land..." she pauses as she dips the quill tip into some black ink.
"A foreigner? From where Mommy!?", you ask excitedly. It is not often you get visitors from a strange land...



As I said, I want this to come after my Starter Conversation Topic. I am using this library for reasons to further my game. Although other suggestions and or another work around (I suppose Ask/Tell...) would be welcome as well. Below is the sample code from my game. Thank you.


<object name="mother">
      <inherit name="editor_object" />
      <inherit name="namedfemale" />
      <inherit name="talkingchar" />
      <alias>mother</alias>
      <greet type="script">
      </greet>
      <hideafter type="boolean">false</hideafter>
      <object name="mother_goodmorning">
        <inherit name="editor_object" />
        <inherit name="startingtopic" />
        <inherit name="namedfemale" />
        <alias>mother_goodmorning</alias>
        <hideafter />
        <nowshow type="stringlist">
          <value>mother_goodmorning</value>
        </nowshow>
        <talk type="script">
          msg ("You rush up to greet her with a cheerful, \"Good morning mother!\".")
          msg ("\"Good morning my Dear!\", she replies with the same enthusiasm.  \"Sleep well?\", she asks as she pulls you onto her lap holding you tightly and moves the wandering blond hairs from your sparkling blue eyes.")
          msg ("You smile and nod, telling a little white lie and she smiles back unknowingly, letting you go as you slide back to the plush carpet, before she resumes what she was doing previously.")
        </talk>
      </object>
      <object name="mother_have_you_seen_father">
        <inherit name="editor_object" />
        <inherit name="namedfemale" />
        <inherit name="startingtopic" />
        <alias>mother_have_you_seen_father</alias>
        <hideafter type="boolean">false</hideafter>
        <nowshow type="stringlist">
          <value>mother_have_you_seen_father</value>
        </nowshow>
        <talk type="script">
          msg ("\"Have you seen papa?\", you ask, although you are sure he is around some where, but where is the question.")
          msg ("You mother looks up briefly from writing, \"He should be in the Meeting Hall discussing today's events...\"")
          msg ("\"What events?\", you ask curiously.")
          msg ("Your mother speaks to you while still engaging in her writing.  You are wondering what it is she is actually writing about.  You mother has such pretty calligraphy...  \"We are having a visitor from a far off land...\" she pauses as she dips the quill tip into some black ink.")
          msg ("\"A foreigner?  From where Mommy!?\", you ask excitedly.  It is not often you get visitors from a strange land.")
        </talk>
      </object>
      <object name="mother_please_tell_me_more_of_the_visitor">
        <inherit name="editor_object" />
        <inherit name="topic" />
        <talk type="script">
          msg ("\"Please tell me more mother.\", you say.")
        </talk>
        <hideafter type="boolean">false</hideafter>
      </object>
    </object>
  </object>

This last bit I did not add much too, since I can not get what I already have working properly. And I have done a few searches and in turn looked through multiple threads, but now I am even more confused then before. My brain feels fried... :?

And since I started this topic I might as well ask this question now as well. Is there a way to make a simple one button press action or simple one conversations like in most old school RPGs, say like Final Fantasy, Dragon Warrior, Wild Arms or Suikoden? Basically each NPC for that quest gives you one line, maybe two or three if the programmers or writers were really trying and then just keep repeating over and over again until you beat that quest or some other major event happened. Than you could talk to almost any NPC again and get a different one or two lines of a conversation and be stuck with that until you beat another quest or found a ruin, etc. A little static, but I like how that can work as well. I am just basically looking for different approaches, but of course stick to one regardless of what I choose for which ever game I am working on.

HegemonKhan
I haven't re-looked at the dynamic conversation library, but a 'simple' code design~method way to do it is with:

'show a menu' script, and 'stringlist', 'stringdictionary, and~or scriptdictionary' Attributes

(if you don't like using 'show a menu', you can create your own custom 'get input' scripting or use the in-line text processor's commands for hyperlinks, but there's a bit more code work needed doing it these ways)

(if you want the dialogue to be game event 'dynamic', it changes based upon events~things that happen in the game and~or game progression points, just implement the 'if' conditionals into the coding, using booleans~flags and~or lists~dictionaries, if you need help with doing this, let me know)

(ask if you're confused with using lists and dictionaries, as they're a bit more advanced code-logic~mentality of conceptualition and thus usage)

http://docs.textadventures.co.uk/quest/ ... _menu.html
http://docs.textadventures.co.uk/quest/ ... lists.html
http://docs.textadventures.co.uk/quest/ ... aries.html

// Scripting (such as for a Verb):

msg ("You finally arrived at your grandmother's house in the middle of the dark woods, and upon seeing her, with inquiring eyes, you try to speak your questions about her ... different ... appearance, but you can't think of the right words to your question.")
dialogue_1_function

<function name="dialogue_1_function">
show menu ("What do you want to ask your grandmother, my child?", game.grandmother_topics_stringdictionary, false) {
invoke (StringDictionaryItem (game.grandmother_topics_stringdictionary, result)
result_x = StringDictionaryItem (game.grandmother_topics_stringdictionary, result
invoke (ScriptDictionaryItem (game.littleredridinghood_response_scriptdictionary, result_x)
}
</function>

// 'Creation' Tags:

<game name="little red riding hood">
// blah code lines
<attr name="grandmother_topics_stringdictionary" type="stringdictionary">
<item>
<key>Oh my grandma, what big eyes you have!</key>
<value>The better to see you with, my dear.</value>
</item>
<item>
<key>Oh my grandma, what big ears you have!</key>
<value>The better to hear you with, my dear.</value>
</item>
<item>
<key>Oh my grandma, what a big nose you have!</key>
<value>The better to smell you with, my dear.</value>
</item>
<item>
<key>Oh my grandma, what big teeth you have!</key>
<value>The better to eat you with, my dear!</value>
</item>
</attr>
<littleredridinghood_response_scriptdictionary type="scriptdictionary">
<item key="The better to see you with, my dear.">
msg ("Teehee, you're funny grandma! I got another question for you!")
// ask if you want this adapted to remove your list of topics, as I'm too tired to re-craft this coding at the moment
dialogue_1_function
</item>
<item key="The better to hear you with, my dear.">
msg ("Teehee, you're funny grandma! I got another question for you!")
// ask if you want this adapted to remove your list of topics, as I'm too tired to re-craft this coding at the moment
dialogue_1_function
</item>
<item key="The better to smell you with, my dear.">
msg ("Teehee, you're funny grandma! I got another question for you!")
// ask if you want this adapted to remove your list of topics, as I'm too tired to re-craft this coding at the moment
dialogue_1_function
</item>
<item key="The better to eat you with, my dear!">
msg ("Teehee, you're funny grandma! ... wait ... what?! ... (screams of fear and terror)")
msg ("GAME OVER")
finish
</item>
</littleredridinghood_response_scriptdictionary>
</game>


-----------

Verbs are great for classic RPGs: NES RPGs like FF1 and DW1

<object name="actions_button">
<alias>ACTIONS</alias>
// your verbs, do this with GUI~Editor as it's easier than via code, see below
</object>

Search ~ Talk ~ Equip
Stats ~ etc etc ~ etc

use your Object 'NAME' or 'ALIAS', as a broader group category, and your Verbs for that object are the specific 'buttons' of that broader category, for good organizational~ergonomic user-friendly design

Object: character
Verbs: equipment, stats, magic, skills~perks, items, etc etc etc

Object: actions
Verbs: explore~search, travel~goto, talk, steal, rest, sleep, change main character, etc etc etc

etc etc etc

-------------------

for random dialogue:

GetRandomInt (min_value, max_value)
( http://docs.textadventures.co.uk/quest/ ... omint.html )

Verb for the 'wise (hint helper) owl characte' Object:

result_x = GetRandomInt (1,3)
msg (StringDictionaryItem (game.dialogue_stringdictionary, result_x)

<game name="blah">
// blah code lines
<attr name="dialogue_stringdictionary" type="simplestringdictionary">1=The evil wizard guards the legendary dragon slayer.;2=The dragon has kidnapped the princess!;3=Rescue the princess to become the ruler of this land!</attr>
</game>

jaynabonne
Since you're open to other approaches, I'd like to offer my response library as a possibility. (That's the result of that "Conversations" thread you also commented on.) It's designed for what you're trying to do (and more). I've attached a demo program that shows some of what you were asking about. The response lib in this zip is the latest one and includes some features not available in the one in the response lib thread (like being able to add, subtract and compare state variables instead of only setting, unsetting and testing for).

If you're interested in this, we can discuss further your specific cases. The main thing to know is that you really need to use code view to edit the responses. If you're not comfortable with that, then this probably won't work for you. It will also make more sense if you view the source in code view. :)

Here is a transcript:

You are in a room.
You can see Mother.
You can go out.

> look at Mother
Mother seems happy to see you.

> look at Mother
She continues doing what she was doing when you came in.

> speak to Mother
(No menu prompt offered here, but could be forced if desired.)
You rush up to greet her with a cheerful, "Good morning mother!". "Good morning my Dear!", she replies with the same enthusiasm. "Sleep well?", she asks as she pulls you onto her lap holding you tightly and moves the wandering blond hairs from your sparkling blue eyes. You smile and nod, telling a little white lie and she smiles back unknowingly, letting you go as you slide back to the plush carpet, before she resumes what she was doing previously.

> speak to Mother
(Menu is offered with prompt: "Ask about papa")
"Have you seen papa?", you ask, although you are sure he is around some where, but where is the question. You mother looks up briefly from writing, "He should be in the Meeting Hall discussing today's events..." "What events?", you ask curiously. Your mother speaks to you while still engaging in her writing. You are wondering what it is she is actually writing about. You mother has such pretty calligraphy... "We are having a visitor from a far off land..." she pauses as she dips the quill tip into some black ink. "A foreigner? From where Mommy!?", you ask excitedly. It is not often you get visitors from a strange land...

> speak to Mother
She says nothing.

> out

You are in a garden.
You can see a gardener.
You can go in or east.

> look at gardener
The gardener is using a hand trowel to dig weeds.

> speak to gardener
He sees you standing there. "There is a shovel in the shed over there." He points to the east. "Could you get it for me, please?"

> speak to gardener
He sees you standing there. "There is a shovel in the shed over there." He points to the east. "Could you get it for me, please?"

> east

You are in a shed.
You can see a shovel.
You can go west.

> take shovel
You pick it up.

> west

You are in a garden.
You can see a gardener.
You can go in or east.

> look at gardener
The gardener is using a hand trowel to dig weeds.

> speak to gardener
"Ah, nice! You brought the shovel. Can I have it?"

> speak to gardener
"Ah, nice! You brought the shovel. Can I have it?"

> give shovel to gardener
You hand the shovel to the gardener. "Thanks very much!" he says, as he begins digging.

> look at gardener
The gardener is digging a hole with a shovel.

> speak to gardener
"I really appreciate you getting me the shovel. Now I really need to get this hole dug!"

> speak to gardener
He ignores you and continues digging.

Edit: The response library thread (with preliminary docs and older lib) is here: viewtopic.php?f=18&t=3909

The Pixie
To get the demo to work try deleting the three named characters, then undoing the deletions. Sounds odd, but it worked for me.

In the demo, if you select a topic, say philippa_key, then go to the Conversation tab, you will see a box with philippa_key_again in it - that is the list of names.

TextStories
Pixie, how exactly am I suppose to load this into my game in the first place? I have the newest version of Quest. I tried to load it as a library going to Advance on the left had side of the screen, as I did with the initial dynamic conversation save. But it just tell me it is not a library. So I try to simply copy and past the code into the code view section. I even deleted the names and then put them back in as you suggested, but it does not work. Is it because the save was made on an older version of quest and both the older version and the save is giving me the problems? It gives me this message-

"Failed to load game.
The following errors occurred:
Error: Cannot find a file called 'ConvLib.aslx' in current path or application/resource path"


And Jay, your proposal sounds interesting, but I am simply not a coder. Equations and things of that nature, even rather simple ones are lost on me. Now if you provided a wide range of in game examples for different things and thus I can pick and choose, thus copying and pasting to my hearts content for most things, but of course to my needs and not simply show me this-

for (iterator variable, int from, int to, int step) { script }

Which completely makes no sense to me than possibly I could use your conversation library and of course give credit where credit is due. And when I say copy and paste, I do not merely mean you write all the stories for me and I copy and paste it. I mean you write the actual in game examples that you think I will need... rather vast I would assume... and I copy and paste what I need and then put my own characters, events and conversations in it. All I need is the skeleton code structure. As I said before, looking at some of the scripts all I see is-

{jasd(huye)hrfuhd(fcyhfc) {yhjc &$ydyhu{&@#u7nbndjnsdjnjn#2- [2jdbn]jnsdjn {1} blahblah}blahblah}blahblah}...

Seriously, this is what I see... hahaha! And so obviously I would prefer not to have to deal with code at all or minimally. But it is not just me, but for the target audience I am making this game for. I want to be able to say, “I made it with this pretty neat program called Quest and I did not have to know any coding at all, come over and try it for yourself.” Now of course if your code became a library for Quest and thus no code needed at all, than all the more better. But in all honesty, if you can help I would not be opposed to it, especially if it does help me and what I am trying to accomplish. So thank you for the offer.

The Pixie
You need to have the ConvLib.aslx file in the same folder as your game or ConvDemo, whichever you are trying to open. In fact, the best way is probably to put both ConvLib.aslx and ConvDemo.aslx in the game directory (which is probably in the folder Documents\Quest Games\<you game> ), so they are all there together, then try to open the demo first, and see if you can get that to work, then your game.

TextStories
Ok Pixie, I tried everything you said, putting both in the actual same folder as my game. I actually made quite a few different test games, because once I did I could not get out of code view. And once I got out of it completely and tried to load it again, it just kept giving me error messages. I was at my wits end and decided to try something else... instead of copying the entire demo from top to bottom I decided to copy everything right after the </game> and down and it worked... I have not spent any time looking at it however in the non-code view, but that will have to wait until later.

However, that does not mean I am still not interested in Jays version of a conversation as well.

And thanks for everyones help. :D

HegemonKhan
this is really complex stuff, so don't worry textstories (this took me 2 long years to understand !!!, lol)

this is only to provide you a very rudimentary understanding of lists (dictionaries are more complex ~ we'll deal with them after you understand and can use lists), and their usage via 'foreach' and 'for', as I'll leave the actual help to Jay and Pixie, as they're much better and more knowledgeable, and better explain'ers then I am.

I'm doing this in code, as I think for once, in code will make more sense than trying to explain via using the GUI~Editor, hehe.

-----------

Lists:

http://docs.textadventures.co.uk/quest/ ... lists.html

game.color_stringlist = split ("red;blue;yellow;green;purple;orange;brown;grey;white;black", ";")

0. red (1)
1. blue (2)
2. yellow (3)
3. green (4)
4. purple (5)
5. orange (6)
6. brown (7)
7. grey (8)
8. white (9)
9. black (10)

the left numbers is their order-index (like in a library, shelving the books by their author's last names' in alphabetical order) to get them from the list, yes it starts from 0 (NOT 1), which makes it very confusing. While the right numbers in the parenthesis is the their 'ListCount'

we got (10) color items in our color list:

ListCount (game.color_stringlist) --> 10

but let's say we want to get to message the color 'brown' in our game:

'for' is for getting a *SPECIFIC SINGLE ITEM OR A SPECIFIC SINGLE RANGE OF ITEMS* in a list

for (item_x, 6, 6) {
msg (item_x)
// outputs in game: brown
}


more examples:

for (item_x, 4, 4) {
msg (item_x)
// outputs in game: purple
}

for (item_x, 0, 0) {
msg (item_x)
// outputs in game: red
}

for (item_x, 9, 9) {
msg (item_x)
// outputs in game: black
}

for (item_x, 10, 10) {
msg (item_x)
// outputs in game: ERROR!!, there is no order-index of 10
}

for (item_x, 0, 5) {
msg (item_x)
// outputs in game: red
// outputs in game: blue
// outputs in game: yellow
// outputs in game: green
// outputs in game: purple
// outputs in game: orange
}

for (item_x, 0, 9) {
msg (item_x)
// outputs in game: red
// outputs in game: blue
// outputs in game: yellow
// outputs in game: green
// outputs in game: purple
// outputs in game: orange
// outputs in game: brown
// outputs in game: grey
// outputs in game: white
// outputs in game: black
}

// the third value, is your skipping increment within your range:

for (item_x, 0, 5, 2) {
msg (item_x)
// outputs in game: red
// outputs in game: yellow
// outputs in game: purple
}

for (item_x, 0, 5, 3) {
msg (item_x)
// outputs in game: red
// outputs in game: green
}

for (item_x, 0, 5, 4) {
msg (item_x)
// outputs in game: red
// outputs in game: purple
}

for (item_x, 0, 5, 5) {
msg (item_x)
// outputs in game: red
// outputs in game: orange
}

for (item_x, 0, 5, 1) {
msg (item_x)
// outputs in game: red
// outputs in game: blue
// outputs in game: yellow
// outputs in game: green
// outputs in game: purple
// outputs in game: orange
}

for (item_x, 1, 5, 2) {
msg (item_x)
// outputs in game: blue
// outputs in game: green
// outputs in game: orange
}

for (item_x, 0, 9, 3) {
msg (item_x)
// outputs in game: red
// outputs in game: green
// outputs in game: brown
// outputs in game: black
}

// hopefully you get the idea now, hehe


and the 'foreach' is even simplier: ALL~EVERY~*EACH*

foreach (item_x, game.color_stringlist) {
msg (item_x)
// outputs in game: red
// outputs in game: blue
// outputs in game: yellow
// outputs in game: green
// outputs in game: purple
// outputs in game: orange
// outputs in game: brown
// outputs in game: grey
// outputs in game: white
// outputs in game: black
}

which is the exact same thing as:

for (item_x, 0, 9) {
msg (item_x)
// outputs in game: red
// outputs in game: blue
// outputs in game: yellow
// outputs in game: green
// outputs in game: purple
// outputs in game: orange
// outputs in game: brown
// outputs in game: grey
// outputs in game: white
// outputs in game: black
}

and

for (item_x, 0, 9, 1) {
msg (item_x)
// outputs in game: red
// outputs in game: blue
// outputs in game: yellow
// outputs in game: green
// outputs in game: purple
// outputs in game: orange
// outputs in game: brown
// outputs in game: grey
// outputs in game: white
// outputs in game: black
}


---------------------

err.... my 'msg' syntax is wrong... but I can address that later, as the purpose of this was just to give you a rudimentary understanding of what lists are and how they're used.

The Pixie
Here are versions of the library and demo that work for me. Try that, and let me know how you get on.


TextStories
Thank you Pixie. I had it working since my last post, but I found a problem with the conversation. If you automatically grab the key and speak to Phil you will say "Hi again", as if you had already had a conversation with her, but had not. The game or the wording of the speech assumes you had already spoken to her. I am aware this was just a demo however, but you would need to use an "If" command or something to correct this right?

And thanks Khan, I will have to check this out later.

The Pixie
Yes, you can check how many times a topic has been displayed with the count attribute, so check if it is zero or not. Eg:

if (philippa_key.count = 0) {
msg ("'Hi,' you say to Philippa, 'I've found a key, and now I just need to find the lock.'")
msg ("'Good luck with that!'")
}
else {
msg ("'Hi again,' you say to Philippa, 'I've got that key. Now I just need to find the lock.'")
msg ("'Good luck with that!'")
}

TextStories
Ok I got the demo of the Dynamic Menus For Conversations to work and even took screen shots how it shows up in my Quest game, but I am not seeing any real differences, minus the wording of the dialog, from it to mine. Yet it keeps telling me I have nothing further to say when I prompt my mother after the Starter Topic, when everything else should pop up as a Conversation Topic and let the player choose what they want to ask/tell next. I am putting the code for the demo here as well as my sample code. Me trying to sort through this mess just isn't working. :shock:

<!--Saved by Quest 5.5.5328.26617-->
<asl version="550">
<include ref="English.aslx" />
<include ref="Core.aslx" />
<include ref="ConvLib.xml" />
<game name="test2">
<gameid>e9cfff90-c70c-4ef8-9b33-7cd4dae1d31a</gameid>
<version>1.0</version>
<firstpublished>2014</firstpublished>
</game>
<object name="room">
<inherit name="editor_room" />
<usedefaultprefix />
<alias>Conversation Testing Room</alias>
<object name="player">
<inherit name="defaultplayer" />
</object>
<object name="teapot">
<inherit name="editor_object" />
</object>
<object name="boris">
<inherit name="editor_object" />
<inherit name="talkingchar" />
<inherit name="male" />
<alias>Boris</alias>
<usedefaultprefix type="boolean">false</usedefaultprefix>
<start_from type="object">room</start_from>
<greet type="script">
msg ("'Hi, who are you,' you say to the man.")
msg ("'I'm Boris.'")
</greet>
<object name="boris_himself">
<inherit name="editor_object" />
<inherit name="startingtopic" />
<nowshow type="list">boris_dock_cranes; mary_dock_cranes</nowshow>
<alias>Himself</alias>
<talk type="script">
msg ("'Tell me about yourself.'")
msg ("'Well, there not much to tell really. I'm just a regular guy. Who like dock cranes.'")
</talk>
</object>
<object name="boris_dock_cranes">
<inherit name="editor_object" />
<inherit name="topic" />
<alias>Dock cranes</alias>
<nowshow type="list">; boris_cranes</nowshow>
<talk type="script">
msg ("'Sure, dock cranes. Cranes you see at the docks. What's wrong with that?'")
</talk>
</object>
<object name="boris_cranes">
<inherit name="editor_object" />
<inherit name="topic" />
<alias>Cranes</alias>
<hideafter type="boolean">false</hideafter>
<talk type="script">
msg ("'I like the ones that run on rails best.'")
</talk>
</object>
</object>
<object name="mary">
<inherit name="editor_object" />
<inherit name="talkingchar" />
<inherit name="female" />
<alias>Mary</alias>
<usedefaultprefix type="boolean">false</usedefaultprefix>
<object name="mary_herself">
<inherit name="editor_object" />
<inherit name="startingtopic" />
<alias>Herself</alias>
<talk type="script">
msg ("'Tell me about yourself.'")
msg ("'I'm 25, I'm a lawyer, and I like chocolate.'")
</talk>
</object>
<object name="mary_dock_cranes">
<inherit name="editor_object" />
<inherit name="topic" />
<alias>Dock cranes</alias>
<talk type="script">
msg ("'Dock cranes? seriously?'")
</talk>
</object>
<object name="mary_teapot">
<inherit name="editor_object" />
<inherit name="topic" />
<alias>Broken teapot</alias>
<talk type="script">
msg ("'You better clear up that mess.'")
</talk>
</object>
<object name="mary_weather">
<inherit name="editor_object" />
<inherit name="topic" />
</object>
</object>
<object name="philippa">
<inherit name="editor_object" />
<inherit name="female" />
<inherit name="talkingchar" />
<alias>Philippa</alias>
<ask type="scriptdictionary" />
<object name="philippa_key">
<inherit name="editor_object" />
<inherit name="startingtopic" />
<alias>Key</alias>
<nowshow type="list">philippa_key_again</nowshow>
<talk type="script">
msg ("'Hi,' you say to Philippa, 'can you help me find the key to this door?'")
msg ("'Sure, you need to look in the bedroom.'")
</talk>
</object>
<object name="philippa_key_again">
<inherit name="editor_object" />
<inherit name="topic" />
<alias>Key</alias>
<hideafter type="boolean">false</hideafter>
<talk type="script">
msg ("'Hi again,' you say to Philippa, 'can you help me find the key to this door?'")
msg ("'Have you tried looking in the bedroom yet?'")
</talk>
</object>
<object name="philippa_got_key">
<inherit name="editor_object" />
<inherit name="topic" />
<alias>Lock</alias>
<hideafter type="boolean">false</hideafter>
<talk type="script">
msg ("'Hi again,' you say to Philippa, 'I've got that key. Now I just need to find the lock.'")
msg ("'Good luck with that!'")
</talk>
</object>
</object>
<object name="key">
<inherit name="editor_object" />
<take />
<ontake type="script">
do (philippa_key, "hide")
do (philippa_key_again, "hide")
do (philippa_got_key, "show")
</ontake>
</object>
</object>
<command name="break_teapot">
<pattern>break teapot</pattern>
<script>
msg ("You break the teapot.")
do (mary_teapot, "show")
</script>
</command>
<walkthrough name="test">
<steps type="list">
talk to philippa
menu:Key
talk to philippa
menu:Key
talk to philippa
menu:Key
get key
talk to philippa
menu:Lock
speak to mary
menu:Herself
speak to mary
speak to boris
menu:Himself
speak to boris
menu:Dock cranes
speak to boris
menu:Cranes
speak to boris
menu:Cranes
speak to boris
menu:Cranes
speak to mary
menu:Dock cranes
break teapot
speak to mary
menu:Broken teapot
break teapot
speak to mary
</steps>
</walkthrough>
</asl>


<object name="mother">
<inherit name="editor_object" />
<inherit name="talkingchar" />
<inherit name="female" />
<alias>Mother</alias>
<hideafter type="boolean">false</hideafter>
<greet type="script">
msg ("\"Good morning.\", she says with a smile.")
msg ("\"Good morning\", you reply back.")
</greet>
<object name="mother_goodmorning">
<inherit name="editor_object" />
<inherit name="startingtopic" />
<alias>Goodmorning</alias>
<hideafter />
<nowshow type="stringlist" />
<talk type="script">
msg ("You rush up to greet her with a cheerful, \"Good morning mother!\".")
msg ("\"Good morning my Dear!\", she replies with the same enthusiasm. \"Sleep well?\", she asks as she pulls you onto her lap holding you tightly and moves the wandering blond hairs from your sparkling blue eyes.")
msg ("You smile and nod, telling a little white lie and she smiles back unknowingly, letting you go as you slide back to your feet on the plush carpet, before she resumes what she was doing previously.")
</talk>
<scenery />
</object>
<object name="mother_have_you_seen_father">
<inherit name="editor_object" />
<inherit name="topic" />
<alias>Have</alias>
<hideafter />
<nowshow type="stringlist" />
<talk type="script">
msg ("\"Have you seen papa?\", you ask, although you are sure he is around some where, but where is the question.")
msg ("You mother looks up briefly from writing, \"He should be in the Royal Counsel Chambers discussing today's events...\"")
msg ("\"What events?\", you ask curiously.")
msg ("Your mother speaks to you while still engaging in her writing. You are wondering what it is she is actually writing about. You mother has such pretty Hyrulian calligraphy... \"We are having a visitor from a far off land...\" she pauses as she dips the quill tip into some black ink.")
msg ("\"A foreigner? From where Mommy!?\", you ask excitedly. It is not often you get visitors from a strange land.")
</talk>
<scenery />
</object>
<object name="mother_please_tell_me_more_of_the_visitor">
<inherit name="editor_object" />
<inherit name="topic" />
<hideafter type="boolean">false</hideafter>
<alias>Please</alias>
<talk type="script">
msg ("\"Please tell me more mother.\", you say.")
</talk>
</object>
</object>
</object>

Ignore the very first greeting by my game. I put the dialouge haphazardly just to get it going. I am getting the same responses now, as I had before I added it this time. (I was trying to mimic that demo to my game as closely as possible.) I do not know the purpose of even having a Greeting Script if it wont start automatically at the start of the game or when you come into a room. (I start the game in that room with mother for my convenience as a tester, but come out and go back in with no greeting dialog...) I mean my original greeting, which is the second part of my dialog seems sufficient enough, but that is considered a Starter Conversation Topics. :? And I still can not get the Conversation Topic to work. Any suggestions? And now I think I remember why my game stalled and why I stopped making it back then... Nothing that has to do with Quest or the community, just my lack of reasoning or following clear directions I guess... :? Also I do not see anything remotely in my game code (And not just the snippet I gave you.) that shows what is at the bottom of the demo version.

<steps type="list">
talk to philippa
menu:Key
talk to philippa
menu:Key
talk to philippa
menu:Key
get key
talk to philippa
menu:Lock
speak to mary
menu:Herself
speak to mary
speak to boris
menu:Himself
speak to boris
menu:Dock cranes
speak to boris
menu:Cranes
speak to boris
menu:Cranes
speak to boris
menu:Cranes
speak to mary
menu:Dock cranes
break teapot
speak to mary
menu:Broken teapot
break teapot
speak to mary
</steps>
</walkthrough>

I would assume I would see "Mother" some where at the bottom of my own code, with maybe "speak to Mother" or </steps>, but I do not.

And Jay, I am slowly, but surely looking at your library/thread, but the more I look, the more code I see and well... yea... :lol:

The Pixie
You need to tell Quest that you want the new topics to appear. Go to your mother_goodmorning object, and the Conversation tab. Click on the Add button, and type in the name (not the lias) of the topic you want to appear. Repeat for each topic.

Here is what it should look like:

topic.png

TextStories
Ahhh! Thank you so much! I had missed that step. :( I did not realize what they had meant by the name, not alias and to what list they meant to stick it in. Just something I over looked several times or simply did not understand. (I think I was sticking the "added" convos to the wrong list...) I may have more questions later, but I will tinker around with this first to see what else I can do and now I can talk the ear off all my NPCs! :mrgreen: Thank you so much again! :D

My revised story...

[-You rush up to greet her with a cheerful, "Good morning mother!"

"Good morning my Dear!", she replies with the same enthusiasm. "Sleep well?", she asks as she pulls you onto her lap holding you tightly and moves the wandering blond hairs from your sparkling blue eyes."

You smile and nod, telling a little white lie and she smiles back unknowingly, letting you go as you slide back to your feet on the plush carpet, before she resumes what she was doing previously.

-"Have you seen papa?", you ask, although you are sure he is around some where, but where is the question.

You mother looks up briefly from writing, "He should be in the Royal Counsel Chambers discussing today's events..."

"What events?", you ask curiously.

Your mother speaks to you while still engaging in her writing. You are wondering what it is she is actually writing about. You mother has such pretty Hyrulian calligraphy... "We are having a visitor from a far off land..." she pauses as she dips the quill tip into some black ink.

"A foreigner? From where Mommy!?", you ask excitedly. It is not often you get visitors from a strange land.

-"Please tell me more mother.", you say, but she is silent.

-"Please tell me more mother.", you say, but she is silent.

-"Please tell me more mother.", you say, but she is silent.

-After many questions, but only moments of silence you begin to do what most kids do... you begin pestering your mother. "Mommy, mommy, mommy, mommy, mommy, mommy, mommy, mommy, mommy, mommy, mommy, mommy, mommy, mommy, mommy, mommy, mommy, mommy, mommy, mommy, mommy, mommy, mommy, mommy, mommy, mommy, mommy, mommy, mommy..."

The queen drops her quill to the desk and begins to rub her temples. Then she looks right at you through the video moniter. "Thanks for showing this person how to properly do Dynamic Menus For Conversations, Pixie..."

:mrgreen:

TextStories
HegemonKhan wrote:

(if you want the dialogue to be game event 'dynamic', it changes based upon events~things that happen in the game and~or game progression points, just implement the 'if' conditionals into the coding, using booleans~flags and~or lists~dictionaries, if you need help with doing this, let me know)

Verbs are great for classic RPGs: NES RPGs like FF1 and DW1

<object name="actions_button">
<alias>ACTIONS</alias>
// your verbs, do this with GUI~Editor as it's easier than via code, see below
</object>

Search ~ Talk ~ Equip
Stats ~ etc etc ~ etc

use your Object 'NAME' or 'ALIAS', as a broader group category, and your Verbs for that object are the specific 'buttons' of that broader category, for good organizational~ergonomic user-friendly design

Object: character
Verbs: equipment, stats, magic, skills~perks, items, etc etc etc

Object: actions
Verbs: explore~search, travel~goto, talk, steal, rest, sleep, change main character


Ok I appreciate all the help with Dynamic Menus For Conversations and even got it working, at least at the most basic level. However, as I had also mentioned in my first post near the bottom, I would like something a little more simplier like you would find in old RPGs. Speaking to someone may give a first time message and then a message after that, both of which I know how to do. The second message will keep repeating, while the first will not. However, let's say Mother wants you to find your father.

- intial greeting - "Good morning Dear.", your mother asks. "How did you sleep?"
- "Go find your father"
- "Go find your father"
- "Go find your father"
- etc.

You found your father and initial greeting - "Good morning Pumpkin.", your father says as he pats you on the head.
- "Go find your mother"
- "Go find your mother"
- "Go find your mother"
- etc.

So after speaking to him you go to your mother again and now the conversation automatically changes.
- "How is your father anyway?"
and it just goes on from there.

I figured I could make an object called "gift" in which your father would ask you to give to your mother on his behalf, and when you have the object "gift" in your inventory, that could be set as a trigger to make your mother say something different and or after it was given to her. But how could I simply talk to father and that alone be enough to trigger a new response from mother? Remember I am no longer using the multiple choice menus, this is strictly old school RPG style now and of course would have to be done with the GUI and not in code. And course the conversations would be more indepth, I am just putting something simple at the moment. Thanks.

HegemonKhan
you can always use flag~boolean, string, integer~double, or list~dictionary checks:

some examples

(think of having a 'checklist', such as a grocery or shopping list, and by using 'if' this item is checked off, then do this)

(lists~dictionaries is the best~most efficient code method)

flags (booleans):

(Descriptive Attributes)
game.killed_evil_wizard = false
game.found_dragon_slayer_sword = false
game.killed_dark_dragon = false
game.returned_princess_to_castle = false
----
Evil Wizard Object's Verb's 'Fight' Script: upon~after~for winning:
game.killed_evil_wizard = true
msg ("After a hard battle, you kill the evil wizard, lifting his magical seal upon the legendary dragon slayer sword.")
----
Dragon Slayer Sword Object's Verb's Scripts:
if (game.killed_evil_wizard = true) {
game.found_dragon_slayer_sword = true
msg ("You take the dragon slayer sword")
}
----
Dragon Object's Verb's Scripts:
if (game.found_dragon_slayer_sword = true) {
game.killed_dark_dragon = true
msg ("you killed the dragon, rescuing the princess.")
}
---
you get the idea...

(undescriptive Attributes)
game.flag_boolean_1 = false~true
game.flag_boolean_2 = false~true
game.flag_boolean_3 = false~true
game.flag_boolean_4 = false~true
game.flag_boolean_5 = false~true

Strings:

game.flag_string_1 = "no"~"yes" // or whatever word~string you want to use (I just chose 'no' and 'yes' for this example), lol
game.flag_string_2 = "no"~"yes"
game.flag_string_3 = "no"~"yes"
game.flag_string_4 = "no"~"yes"
game.flag_string_5 = "no"~"yes"
---
if (flag_string_1 = "yes") {
(same as concept of the boolean example above)

Integers~Doubles:

(binary: ' 0=off ' and ' 1=on ' )

flag_integer_1 = 0~1
flag_integer_2 = 0~1
flag_integer_3 = 0~1
flag_integer_4 = 0~1
flag_integer_5 = 0~1
----
if (flag_integer_1 = 1) {
(same as concept of the boolean example above)

----------------

or, a different usage for Integer~Double and String Attributes (since they aren't limited to only two choices like the Boolean Attributes are):

(Integer~Double Attributes)
game.event_flag_integer = 0~1~2~3~4~5~6
---
if (game.event_flag_integer = 0) {
// script 1
} else if (game.event_flag_integer = 1) {
// script 2
} else if (game.event_flag_integer = 2) {
// script 3
}
// etc etc etc

(String Attributes)
game.event_flag_string = "a"~"b"~"c"~"d"~"e"~"f"~"g"
---
if (game.event_flag_string = "a") {
// script 1
} else if (game.event_flag_string = "b") {
// script 2
} else if (game.event_flag_string = "c") {
// script 3
}
// etc etc etc

-------------

Lists~Dictionaries:

(I'm using code, hopefully you can 'translate~convert' it with how to do it in~with~via using the GUI~Editor)

<game name="xxx">
// blah code lines
<mother_stringlist type="simplestringlist">0</mother_stringlist>
<father_stringlist type="simplestringlist">0</father_stringlist>
</game>

<object name="npc_1">
<inherit name="editor_object" />
<alias>mother</alias>
<communicate type="script">
firsttime {
msg ("/"Good morning Dear./", your mother asks. /"How did you sleep?/"")
} otherwise {
if (ListContains (game.mother_stringlist, "0") {
msg ("Go find your father")
list add (game.father_stringlist, "1")
list remove (game.father_stringlist, "0")
} else if (ListContains (game.mother_stringlist, "1") {
msg ("Tell him to come here!")
list add (game.father_stringlist, "2")
list remove (game.father_stringlist, "1")
} else if (ListContains (game.mother_stringlist, "2") {
msg ("Honey, go buy me a new car!")
list add (game.father_stringlist, "3")
list remove (game.father_stringlist, "2")
}
}
</communicate>
</object>

<object name="npc_2">
<inherit name="editor_object" />
<alias>mother</alias>
<communicate type="script">
firsttime {
msg ("/"Good morning./", your father asks. /"How did you sleep?/"")
} otherwise {
if (ListContains (game.father_stringlist, "0") {
msg ("Go talk to your mother")
} else if (ListContains (game.father_stringlist, "1") {
msg ("What does your mother (or my wife) need from me, my son?")
list add (game.mother_stringlist, "1")
list remove (game.mother_stringlist, "0")
} else if (ListContains (game.father_stringlist, "2") {
msg ("Alright, I'm coming")
list add (game.mother_stringlist, "2")
list remove (game.mother_stringlist, "1")
}
}
</communicate>
</object>

<verb>
<property>communicate</property>
<pattern>communicate</pattern>
<defaultexpression>xxx</defaultexpression>
</verb>


you can do more with lists too (using 'and' and~or 'or' operators), and then there's dictionaries too...

The Pixie
I would have an integer attribute on both mother and father, called state, and increment it as the conversation develops. So for mother, for example (note this is not proper code, brackets are missing and quotes are wrong):

if (mother.state = 0)
msg("Good morning Dear.", your mother asks. "How did you sleep?")
mother.state = 1

else if (mother.state = 1 and father.state = 0)
msg("Go find your father")

else
msg("I see you found your father")

Similarly, father.state would become 1 after talking to him.

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

Support

Forums