I just want to talk to the Monkey: Not a programmer should I give up?

So I know about 3 lines of LUA that's... It. And one of those is hudPrint"." So yeah... I'm super in the mix with programming. Everything was goi going fine, I've been working on a game for a few days and I have sussed out most of my issues but... I CAN'T TALK TO THE MONKEY!

I can't get as far ask - Talk Monkey "what do you want to talk about?" Then bubkis. Tried making a list, can't figure it out. Tried the over complicated question tab (it's overcomplicated and hates me, tried making each question an object or some such thing and died a little inside.

Look. I just want an easy way have the monkey ask what I wanna talk about then show a list of topics. Then click on or type the topic and it print out an answer...
HALP!


The best way to manage conversations is to hide the text bar and manage it all using commands displayed as links using the text processor (like what happens in most graphic adventures/RPGs) and unhiding the the text bar when the conversation has concluded.


What silver said.

You could also look into the ConvLib the Pixie wrote. It's easy to use and works well.


a simple example in code:

(if using quest on the desktop/off-line: just right click on your 'XXX.aslx' game file and 'open' it with a text editor software: notepad, wordpad, Apple: text editor, notepad++, etc, and find and match up your stuff with my code below, as needed --- if you need help let us know)

(if using quest on-line/web, you got to download your game, then unzip the 'XXX.quest' publishing file using free unzipping software, to unbundle it, to get at your 'XXX.aslx' game file within it, and then do the same as above)

(ALWAYS MAKE/SAVE/HAVE A BACKUP COPY OF YOUR 'XXX.aslx' GAME FILE BEFORE YOU START MESSING WITH IT)

(just replace my CAPITALIZED stuff with whatever you want, note that whatever you change my ''FIRST TOPIC', to being, you must change all of my uses/instances of 'FIRST TOPIC' in the code below, to exactly, as quest is 'upper-lower case' sensitive and it is also 'space' sensitive too, what you changed it into being, and the same with the 'SECOND TOPIC' and 'THIRD TOPIC', you can add more topics or remove topics, following the same rules)

<object name="room">

  <inherit name="editor_room" />

</object>

<object name="monkey">

  <inherit name="editor_object" />

  <attr name="parent" type="object">room</attr>

  <attr name="talk" type="script">

    show menu ("Ask about what topic?", monkey.topics, false) {
      switch (result) {
        case ("FIRST TOPIC") {
          msg ("MESSAGE 1")
        }
        case ("SECOND TOPIC") {
          msg ("MESSAGE 2")
        }
        case ("THIRD TOPIC") {
          msg ("MESSAGE 3")
        }
      }
    }

  </attr>

  <topics type="stringlist">

    <value>FIRST TOPIC</value>
    <value>SECOND TOPIC</value>
    <value>THIRD TOPIC</value>

  </topics>

  <displayverbs type="stringlist">

    <value>talk</value>

  </displayverbs>

</object>

<verb>

  <property>talk</property>
  <pattern>talk</pattern>
  <defaultexpression>You can't talk about that!</defaultexpression>

</verb>

if you still need help, let us know, as ultimately, you can always post/pm your entire game code, and we can fix it up so that it works for you, and return the fixed-up/working game code back to you.


don't worry/freak-out about any errors/crashes, as all that means is that something is wrong in your code, and it's just a matter of finding them and fixing them up.

coding is the ultimate spelling-nazi, as your code must be 100% error/typo/mistake free, coding trains you to be very good at spell-checking, finding typos/mistakes, and etc, lol


I don't think that it is needed to list available topics. I use the speak to verb. The NPC will give relevant information according to the player's position in the story line. The speak to verb will draw from a string list attribute within the NPC that can be added to or deleted from as the player advances the story.

The ask/tell feature can also be used alone or in conjunction with the speak to verb if the player wants to be more specific about topic in the conversation with a NPC.

It would depend on preference and the desire for a certain level of difficulty as to whether a creator uses any of these or those mentioned prior.


<offtopic>
Also: You win the best-thread-name-award!
</offtopic>


Well... At least I won am award. I'll try this stuff and see how it goes. Thanks all.


I think HK's example should be pretty much what you're wanting.

His example will basically do the same thing Silver suggests (except for hiding the input bar, and I prefer being able to use the keyboard throughout a text adventure -- never having to click; so I am biased).


Also see:

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


Log in to post a reply.

Support

Forums