Need help with basic dialogue stuff.

Hello, I've started writing my quest recently, but I'm getting a little lost in the tutorial and documentation. What I'm searching for is the way to make player's questions/responces disappear from the options after they've been asked while keeping all of the unanswered ones avaliable.

In case that's not clear enough, here's the example of what's I'm trying to achieve:

Dialogue

  • question 1
  • question 2
  • question 3

If the player chooses question 2, they should get:

Response 2

  • question 1
  • question 3

That works exactly like the dialogue system in most RPGs, where the bottom option should end the discussion. I would be very grateful if someone pointed me in the right direction.


have you seen this link?: https://docs.textadventures.co.uk/quest/display_verbs.html

quest has two built-in String List Attributes, 'displayverbs' and 'inventoryverbs', which holds your Verbs (Script Attributes with extra coding to give them their 'Verb' Functionality), and controls their displayment, via adding/removing the Verbs from the built-in 'displayverbs' and 'inventoryverbs' String List Attributes

the 'inventoryverbs' controls the displayment of the Verb for when the Object is in your inventory (within your Player Object)

the 'displayverbs' controls the displayment of the Verb for when the Object is NOT in your inventory (within the room you're within)

working with List and Dictionary Attributes is a bit more advanced than the "normal" Attributes (Strings, Booleans, Integers, Doubles, and etc), but it's really not too bad, just takes a bit of time to learn them


here's a simple example of removing topics:

http://docs.textadventures.co.uk/quest/scripts/show_menu.html
http://docs.textadventures.co.uk/quest/scripts/switch.html

'show menu' does a pop up menu window

'ShowMenu' does an 'inline' menu (blue hypertext links)

<asl version="550">

  <include ref="English.aslx" />
  <include ref="Core.aslx" />

  <game name="NAME_OF_GAME">

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

      do (topics_object, "topics_script_attribute")

    </attr>

  </game>

  <object name="room">

    <inherit name="editor_room" />

  </object>

  <object name="player">

    <inherit name="editor_object" />
    <inherit name="editor_player" />

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

  </object>

  <object name="topics_object">

    <inherit name="editor_object" />

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

      show menu ("Topic?", topics_object.topics_stringlist_attribute, false) {

        // quest automatically (hidden from you) stores your selection in the 'result' Variable Variable:
        //
        // depending on which was your selection:
        //
        // result = "princess"
        // or
        // result = "dragon"
        // or
        // result = "sword"
        // or
        // result = "wizard"

        switch (result) {

          case ("princess") {

            msg ("The princess has been kidnapped by a dragon!")

          }

          case ("dragon") {

            msg ("The dragon can only be killed by the legendary dragon slayer sword")

          }

          case ("sword") {

            msg ("The legendary dragon slayer sword is guarded by a powerful wizard")

          }

          case ("wizard") {

            msg ("the powerful wizard can be found within his tower")

          }

        }

        on ready {

          list remove (topics_object.topics_stringlist_attribute, result)

          // these code lines below, causes this entire scripting (topics_object.topics_script_attribute) to loop until all topics have been selected/removed (we need some kind of 'check' in order to exit out of the looping, as infinite loops are very bad: they will crash quest, as the computer's resources/space/memory isn't infinite):

          if (not ListCount (topics_object.topics_stringlist_attribute) = 0) {

            do (topics_object, "topics_script_attribute")

          }

        }

      }

    </attr>

    <topics_stringlist_attribute type="stringlist">

      <value>princess</value>
      <value>dragon</value>
      <value>sword</value>
      <value>wizard</value>

    </topics_stringlist_attribute>

  </object>

</asl>

Option 1. Use Ask/Tell
Tutorial here. Scroll down to see it.
http://docs.textadventures.co.uk/quest/tutorial/more_things_to_do_with_objects.html
Option 2. Get input and if statements

get input {
  if (result = "yes") {
    msg ("")
  }
  if (result = "no")
    msg ("")
  }
}

Option 3. Show Menu

options = Split("yes;no", ";")
ShowMenu ("yes or no", options, true) {
  switch (result) {
    case ("yes") {
      msg ("")
    }
    case ("no") {
      msg ("")
    }
  }
}

Don't paste this directly in, Show Menu hates working with code view.


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

Support

Forums