Adventure.js Docs Downloads
Score: 0 Moves: 0
Tutorial explaining how to modify verbs in Adventurejs. tutorial, verbs

How to:Modifying Verbs

Modifying Verbs body text.

  • patchVerb() lets an author replace only selected properties and methods of any predefined Verb.
  • replaceVerb() lets an author completely replace any of the predefined Verbs.
  • combineVerbs() lets an author consolidate predefined Verbs. Some of the predefined Verbs exist to catch subtle distinctions that may not be necessary for your game. For instance, twist and turn are predefined as distinct Verbs. If you don't need that level of distinction, you can use combineVerbs to consolidate them.
  • disableVerbs() lets an author delete specified Verbs from their game's Dictionary. Useful when you don't want to support certain Verbs.
  • enableVerbs() lets an author re-enable Verbs that have been disabled.
  • disableAllVerbsBut() lets an author disable all but specified Verbs. Useful for creating a game with limited language.
  • createVerb() lets an author create a new Verb from scratch.
  • doVerb() lets an author call a Verb from custom code during runtime.
  • verb subscription with_success
  • override_verb_success_msg - a simple method that overrides
  • override_verb_failure_msg - simple but inflexible
  • REPLACE WITH with_failure


// patchVerb()

MyGame.patchVerb({ name: "go_out_from_under", prettyname: "crawl out from under", // change prettyname verb_prep_prep_noun: [ "out from under" ], verb_prep_prep_prep_noun: [ "crawl out from under", // add new pattern ], });


MyGame.replaceVerb( "xyzzy", { name: "xyzzy", prettyname: "xyzzy", synonyms: [], verb_prep_noun: [], verb_noun_prep_noun: [], verb_noun_prep_noun_prep_noun: [], do: function( params ) { console.log( "" ); var msg = "Clever xyzzy response!"; if(msg) msg, MyGame.input.output_class ); return params }, });

// combineVerbs()

MyGame.combineVerbs( [ "twist" ], "turn" );

// disableVerbs()

MyGame.disableVerbs( [ "lick", "eat" ] );

// enableVerbs()

MyGame.enableVerbs( [ "lick", "eat" ] );

// disableAllVerbsBut()

MyGame.disableAllVerbsBut( [ "look", "examine" ] );

// createVerb()

MyGame.createVerb({ name: "blab_about", prettyname: "blab about", verb_prep_noun: [ "blab about" ], // blab about thing verb_noun_prep_noun: [ "blab about" ], // blab person about thing doTry: function( input ) { [insert logic here] return true; }, doSuccess: function( input ) { [insert logic here] return true; }, });

// doVerb() (call during runtime)"xyzzy");

Created by Ivan Cockrum on Sunday, May 29, 2022.
For more information, please send mail to
Documentation generated by JSDoc 3.6.11 on Mon Nov 20 2023 18:04:50 GMT-0800 (Pacific Standard Time)
Found a problem or error in the docs? Report it to