Creating Verbs on Types?

I was just wondering if you could create a VERB on a TYPE Attribute. Anyone know for sure if it's possible?

Anonynn.


Verbs are just Script Attributes with some additional coding stuff to give them the Verb functionality

<object name="example_1_object">
  <inherit name="example_type" />
</object>

<object name="example_2_object">
  <inherit name="example_type" />
</object>

<object name="example_2_object">
  <inherit name="example_type" />
</object>

<type name="example_type">
  <attr name="script_attribute_1" type="script">
    msg ("script_attribute_1 is your verb_1")
  </attr>
  <attr name="script_attribute_2" type="script">
    msg ("script_attribute_2 is your verb_2")
  </attr>
  <attr name="script_attribute_3" type="script">
    msg ("script_attribute_3 is your verb_3")
  </attr>
  <attr name="displayverbs" type="simplestringlist">script_attribute_1;script_attribute_2;script_attribute_3</attr>
<attr name="inventoryverbs" type="simplestringlist">script_attribute_1;script_attribute_2;script_attribute_3</attr>
</type>

<verb>
  <property>script_attribute_1</property>
  <pattern>script_attribute_1</pattern>
  <defaultexpression>blah blah blah</defaultexpression>
</verb>

<verb>
  <property>script_attribute_2</property>
  <pattern>script_attribute_2</pattern>
  <defaultexpression>blah blah blah</defaultexpression>
</verb>

<verb>
  <property>script_attribute_3</property>
  <pattern>script_attribute_3</pattern>
  <defaultexpression>blah blah blah</defaultexpression>
</verb>

Pixie understands Verbs well, so he can probably help with this stuff, as I could never figure out how to work out how to use a separate Verb Name from its Verb Property and Verb Pattern... but I'm sure there's a way to do it (I just don't understand it enough to get it to work), and I'm sure it can be connected to a Command too:

<object name="example_1_object">
  <inherit name="example_type" />
</object>

<type name="example_type">
  <attr name="kick_script_attribute" type="script">
    msg ("script_attribute_1 is your verb_1")
  </attr>
  <attr name="punch_script_attribute" type="script">
   msg ("punch")
  </attr>
  <attr name="displayverbs" type="simplestringlist">punch_script_attribute;kick_script_attribute</attr>
</type>

<verb name="punch_script_attribute>
  <property>punch</property>
  <pattern>punch</pattern>
  <defaultexpression>blah blah blah</defaultexpression>
</verb>

<verb name="kick_script_attribute>
  <property>kick</property>
  <pattern>kick</pattern>
  <defaultexpression>blah blah blah</defaultexpression>
</verb>

<command name="punch_command">
  <pattern>punch #object_parameter#</pattern>
  <script>
    msg ("punch " + object_parameter.name)
  </script>
</command>

<command name="kick_command">
  <pattern>kick #object_parameter#</pattern>
  <script>
    msg ("kick " + object_parameter.name)
  </script>
</command>

Yes. The Editor does not give you a Verb tab, so you have to do it via the attributes tab, and you have to ensure the verb element is also created.

In fact the best way is to set up the verb on an object first, then go to the Attributes tab of the object to see what the attribute it, and then copy that across to the type.


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

Support

Forums