Pre-release
Adventure.js Docs Downloads
Score: 0 Moves: 0
Tutorial explaining how to use Verb Subscriptions in Adventurejs. tutorial, verb subscriptions

Start Scripting:Verb Subscriptions

To be written...

object_of_verb is a template data structure used by asset.setVerbSubscription() to set individual assets' relationship to specified verbs. Each asset.dov.verb will receive the following properties and default values.

  • name: '' the name of the verb.
  • inherited_from: 'Asset' the name of the class this verb is inherited from. Since these properties aren't distinctly documented, this is offered as a convenience method for tracking down inherited verb settings.
  • enabled: true allows changing the state of an object's responsiveness to a given verb.
  • automatically: true allows for some verbs to be performed automatically if context calls for it, for example, when unlocking a door in order to pass through it. This takes precedence over global settings.
  • automatically_after_use: true if automatically if set true, this sets it so that a verb can only be applied automatically once a player has already used it.
  • then_disable: false if true, asset can only be successfully used once with given verb, but is left in place after use.
  • with_anything: true pertains only to indirect objects. If true, this asset can be used as an indirect object of this verb with any direct object.
  • with_assets: [] allows author to define a single asset that can interact with this one using the given verb, for example "unlock door with key" where key is the only asset that can unlock door.
  • with_classes: [] allows author to define an entire class that can interact with this asset using the given verb, for example "unlock door with skeleton key" where any instance of the class SkeletonKey can unlock door.
  • with_nothing: true pertains only to direct objects. If true, the specified verb can be applied to the direct object without the use of any indirect object.
  • on_success: '' is an optional parameter. Anything it contains may be appended to the end of the verb's doSuccess output.
  • then_destroy: false allows author to specify that this asset should be destroyed after using. If true, asset is destroyed after a single use regardless of how once is set. then_destroy may optionally be stored as an object that appends results to the end of doSuccess: then_destroy: { on_success: 'foo' }