Synonyms for Verbs

I am using the in-browser version of question and have a question for how to accomplish something.

In one of my rooms, I have a 'torch' object that the player needs to use on a 'rope' object to open a door. So i have a 'burn' verb on the rope object. However, there are a few different ways a play may attempt to complete this action, and as I wondering if there was a more efficient way than just copying and pasting the 'burn' verb for these other wordings.

Essentially, is there a way to add synonyms (other names) for verbs like you can for object aliases.


There might be a better way, but what I do is define the script for the main verb, say "burn rope" and then invoke that script for the synonyms or equivalent actions using do (rope, "burn").

So, for example, it could be used for 'light rope' or 'use torch with rope'.


you can add more patterns, via the semicolon:

(I'm not sure with Verbs if can, but easy to try/test it. If can't, then you can use/add/create a Command, and then have the Command's scripting call the Verb that you want, I'll show an example of it below as well)

(Using a 'Command' Element for an example, Commands take user's typed-in inputs, in the GUI/Editor, on the left side's "tree of Elements/stuff", under the 'game' Game-Settings-and-Publishing_Info Object, there should be 'Verbs' and 'Commands', highlight the 'Command', obviously, and then set it up, similar to below example)

(due to parsing issues, always start with the most complex/longest pattern to the least)

(you might not want to use single letters, as you might want to use them for something else more useful, and/or they're already built-in for useful things, like the 'x' for 'examine', and 'i' for 'inventory', and whatever else is built-in)

(Verbs are just Script Attributes with some extra coding fluff to make them function as Verbs)

for using/activating a Command in game play, you'd type in (for this example): burn rope

<object name="rope">

  <displayverbs type="stringlist">

    <value>burn</value>

  </displayverbs>

  <inventoryverbs type="stringlist">

    <value>burn</value>

  </inventoryverbs>

  <attr name="burn" type="script">
    // scripting
  </attr>

</object>

<command name="burn_command">

  <pattern>burn #object#;b #object#;incinerate #object#;i #object#;roast #object#;r #object#</pattern>

  <script>

    if (object = rope) {
      // scripting
    }

    // or calling upon the 'burn' Verb:

    if (HasScript (object, "burn")) {
      invoke (object.burn)
    } else {
      msg ("You can't burn that!")
    }

  </script>

</command>

<verb>

  <property>burn<property>
  <pattern>burn<pattern>

  <defaultexpression>You can't burn that!</defaultexpression>

</verb>

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

// you may be able to simply do multiple patterns on the verb:

<verb>

  <property>burn<property>
  <pattern>burn;b;incinerate;i;roast;r<pattern>

  <defaultexpression>You can't burn that!</defaultexpression>

</verb>

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

Support

Forums