Subcommands by Daniel Stelzer


This extension exposes the snippet which refers to each individual object, as its 'subcommand'.

the subcommand of (object) -> snippet

If the player types "take the wand", referring to the black rod with a rusty star on the end, then the subcommand of the rod is "wand". This can be useful in disambiguation, or in adapting a description to use the player's phrasing.

As of version 2, it now also provides the subcommand of the verb:

the subcommand of the verb -> snippet

This provides all the literal text at the beginning of the grammar line: in I6 terms, the verb and all following prepositions.

Example: ** Subcommand Laboratory - A simple demonstration of how subcommands affect the parser.

Include Subcommands 6M62 by Daniel Stelzer.

Every turn:

say "Verb subcommand: [the subcommand of the verb].";
if the noun is not nothing:
     say "Noun subcommand: [the subcommand of the noun].";
if the second noun is not nothing:
     say "Second noun subcommand: [the subcommand of the second noun].";

The Laboratory is a room. A red apple, a green apple, a red pear, and a green pear are in the Laboratory. A shiny wooden box is a container in the Laboratory. It is closed and locked. The player carries a silver metal key.

Does the player mean taking the red apple when the subcommand of the red apple includes "red": it is very likely. Does the player mean taking the green apple when the subcommand of the green apple includes "apple": it is very likely.

Test fruit with "get red / drop it / get apple / get pear". Test box with "unlock the shiny wooden box with the silver key". Test verbs with "x me / look at me / throw box at me".