Login
Remember
IF Answers
Ask a Question

# How do I make verbs synonymous for only certain objects in Quest 5.6.1?

0 votes
149 views
asked Sep 30 in Authoring by Nokhsa
edited Sep 30

I'm a beginner at this. And I just discovered library elements as I was typing this question, so I'm sorry if I'm right at the answer now. But I've spent too much time on this already and I think other people would wonder this, too. I'll post the answer if I figure it out.

I'm using the Quest 5.6.1 windows program, I'm not using the browser version.

In my game, there is a book. I've given the book "one" verb that has many synonyms. It's this:

turn through; flip through; scan; read; open; thumb through; page through; look in; look inside

Please note that one of the synonyms is "open". More recently, I added my first container object to the game. One of it's default verbs is "open".

When I try to open it with the "open" verb, it says this:

You can't turn through; flip through; scan; read; open; thumb through; page through; look in; look inside it.

As an experiment, I wanted to try giving the verb "open" to an object that isn't a container and see if I have the same problem, but when I type "open" and click the ok button, it comes up as "turn through; flip through; scan; read; open; thumb through; page through; look in; look inside", even though I only typed "open".

So, I think you can tell what my intentions are. I would like for the player to be able to use any of those words to open; read; etc. the book. I don't want the player to type something that to a human being clearly means that they want to open the book and read its pages and have the game tell them that it doesn't know how to do that.

How do I make the words in my verb string synonymous only for one object, in this case, the book?

It would be nice if I could create a designation (a flag, maybe?) for every object that I would want this string to apply to, in other words, books, magazines; any reading material composed of pages.

I hope this isn't a stupid question. I've been looking all over the place to solve this.

Thanks for giving me your time.

- quest
- verbs
- synonyms

## 1 Answer

0 votes
answered Oct 11 by hegemonkhan (161 points)
edited Oct 11 by hegemonkhan

.1. your 'one' Verb's synonim 'open' appears to have over-ridden the built-in 'open' Verb, thus you've lost your normal 'open' functionality. Don't over-write quest's built-in features like the 'open' Verb (unless you're a good programmer), so remove your 'open' synonim for your 'one' Verb, to get back your 'open' Verb functionality. Instead, you could alter your 'open' Verb, giving IT all of those synonims that you want, and use the new altered 'open' Verb for your 'book + whatever' Objects. If you use the GUI~Editor, its safe to change the built-in stuff, as you're forced to click on a 'copy' button, which makes a copy that you then adjust, preserving the built-in thing. This is done via in the lower-left corner: Filter -> Show Library Elements -> (toggle~check it, so it is toggled~checked on), what this does is reveal (unhide ~ make visible) all of the built-in stuff in the 'tree of stuff' on the left side, as light grey text. Find 'open', and click on it so it is highlighted, then on the right side, click the 'copy' button. Then, you can change the copy of 'open', though you got to know what you're doing, of course.

.2A. OBJECT TYPES (quest's user-level's: classes~groups):

http://docs.textadventures.co.uk/quest/elements/type.html (Object Types)
http://docs.textadventures.co.uk/quest/types.html (Object Types)
http://docs.textadventures.co.uk/quest/tutorial/using_inherited_types.html (these special 'Inherited' Attributes is how you add an Object Type to an Object)
http://docs.textadventures.co.uk/quest/guides/using_types.html (Object Types)
http://docs.textadventures.co.uk/quest/guides/using_types_and_tabs__advanced_.html (a bit on Object Types)
http://docs.textadventures.co.uk/quest/guides/simple_combat_system__advanced_.html (a bit on Object Types)

Object Types hold Attributes (including Script Attributes, or "Verbs" as you know them in the GUI-Editor), and~or other Object Types.

This "basket" (Object Type) of eggs (Attributes and~or other Object Types) can be given to Objects, and thus giving those Objects all of its "eggs".

Do note that when you add~create Script Attributes in your Object Type, you need to use the special word 'this' for the 'Object_name' for the scripting, as what the 'this' does is to get the Object that has this Object Type added to it.

that was confusing.... maybe an example (in code for quickness) will be less confusing... lol. See below for an example of what Object Types do, and how their used. My example is applicable to your question, though you'll probably need help in making that conversion.

.2B. Scripting (but this is quite advanced, requires you to not only know how to code, but code well too)

NOT using Object Types (YUCK!):

    <object name="orc_1">
      <attr name="alias" type="string">orc</attr>
      <attr name="hostile" type="boolean">true</attr>
      <attr name="fight" type="script">
        if (orc.hostile)
        {
          msg ("You fight and kill the " + orc_1.alias + ".")
        }
      </attr>
      <attr name="displayverbs" type="simplestringlist">fight</attr>
    </object>

    <object name="orc_2">
      <attr name="alias" type="string">orc</attr>
      <attr name="hostile" type="boolean">true</attr>
      <attr name="fight" type="script">
        if (orc.hostile)
        {
          msg ("You fight and kill the " + orc_2.alias + ".")
        }
      </attr>
      <attr name="displayverbs" type="simplestringlist">fight</attr>
    </object>

    <object name="ogre">
      <attr name="alias" type="string">ogre</attr>
      <attr name="hostile" type="boolean">true</attr>
      <attr name="fight" type="script">
        if (ogre.hostile)
        {
          msg ("You fight and kill the " + ogre.alias + ".")
        }
      </attr>
      <attr name="displayverbs" type="simplestringlist">fight</attr>
    </object>

    <object name="troll">
      <attr name="alias" type="string">troll</attr>
      <attr name="hostile" type="boolean">true</attr>
      <attr name="fight" type="script">
        if (troll.hostile)
        {
          msg ("You fight and kill the " + troll.alias + ".")
        }
      </attr>
      <attr name="displayverbs" type="simplestringlist">fight</attr>
    </object>

    <object name="goblin">
      <attr name="alias" type="string">goblin</attr>
      <attr name="hostile" type="boolean">true</attr>
      <attr name="fight" type="script">
        if (goblin.hostile)
        {
          msg ("You fight and kill the " + goblin.alias + ".")
        }
      </attr>
      <attr name="displayverbs" type="simplestringlist">fight</attr>
    </object>

    <object name="gremlin">
      <attr name="alias" type="string">gremlin</attr>
      <attr name="hostile" type="boolean">true</attr>
      <attr name="fight" type="script">
        if (gremlin.hostile)
        {
          msg ("You fight and kill the " + gremlin.alias + ".")
        }
      </attr>
      <attr name="displayverbs" type="simplestringlist">fight</attr>
    </object>

    <object name="cyclops">
      <attr name="alias" type="string">cyclops</attr>
      <attr name="hostile" type="boolean">true</attr>
      <attr name="fight" type="script">
        if (cyclops.hostile)
        {
          msg ("You fight and kill the " + cyclops.alias + ".")
        }
      </attr>
      <attr name="displayverbs" type="simplestringlist">fight</attr>
    </object>

    <verb>
      <property>fight</property>
      <pattern>fight</pattern>
      <defaultexpression>"You can't fight that"</defaultexpression>
    </verb>

VS

using Object Types (much better!):

    <type name="monster">
      <attr name="hostile" type="boolean">true</attr>
      <attr name="fight" type="script">
        if (this.hostile)
        {
          msg ("You fight and kill the " + this.alias + ".")
        }
      </attr>
      <attr name="displayverbs" type="simplestringlist">fight</attr>
    </type>

    <object name="orc_1">
      <inherit name="monster" />
        <attr name="alias" type="string">orc</attr>
    </object>

    <object name="orc_2">
      <inherit name="monster" />
        <attr name="alias" type="string">orc</attr>
    </object>

    <object name="ogre">
      <inherit name="monster" />
       <attr name="alias" type="string">ogre</attr>
    </object>

    <object name="troll">
      <inherit name="monster" />
      <attr name="alias" type="string">troll</attr>
    </object>

    <object name="goblin">
       <inherit name="monster" />
      <attr name="alias" type="string">goblin</attr>
    </object>

    <object name="gremlin">
      <inherit name="monster" />
      <attr name="alias" type="string">gremlin</attr>
    </object>

    <object name="cyclops">
      <inherit name="monster" />
      <attr name="alias" type="string">cyclops</attr>
    </object>

    <verb>
      <property>fight</property>
      <pattern>fight</pattern>
      <defaultexpression>"You can't fight that"</defaultexpression>
    </verb>

## Related questions

- How do I retrieve values from a dictionary in Quest 5.6?
- How do I find the default parser verbs in Quest?
- How do I set up an "If" for a container to have multiple objects?
- Quest - why does the # disappear when I add a verb?
- Quest: Can I hide and unhide a Verb?

...