Menus by Emily Short

Version 3

A table-based way to display full-screen menus to the player.

"Menus" provides a table-based way to display menus to the player. The menu takes over the main screen of the game and prevents parser input while it is active.

"Menus" is not suitable for contexts where we want the player to be able to choose a numbered option during regular play (such as a menu of conversation choices when talking to another character). It is intended rather for situations where we wish to give the player optional instructions or hints separated from the main game.

Any given menu option may do one (and only one) of the following three things:

1) display some text to the player, after which he can press a key to return to the menu. This tends to be useful for such menu options as "About this Game" and "Credits", where we have a few paragraphs of information that we would like to share.

2) trigger a secondary menu with additional options. The player may navigate this submenu, then return to the main menu. Submenus may be nested.

3) carry out a rule. This might perform any action, including making changes to the game state.

Menus are specified by tables, in which each row contains one of the menu options, together with instructions to Inform about how to behave when that option is selected.

Each menu table should have columns called "title", "subtable", "description", and "toggle".

"Title" should be the name of the option we want the player to see: "Credits", "Hints", "About This Game", and so on.

"Description" is the text that will be printed when the option is selected. We can fill it in with as much information as we like.

"Subtable" is used to create a submenu; this column holds the name of the table that specifies the menu. For instance:

Table of Options
title     subtable     description     toggle
...
"Settings"     Table of Setting Options     --     --

would create an option entitled "Settings", which the player could select to view a submenu of setting options. That submenu would in turn need its own table, thus

Table of Setting Options
title     subtable     description     toggle
...

If we do not want a given option to trigger a new submenu, we should leave it as "--".

The "toggle" column contains the rule carried out when this option is chosen. In theory, this rule could be absolutely anything. In practice, the feature is mostly useful for giving the player a table of setting options which he can toggle on and off: for instance, we might provide the option "use verbose room descriptions", and then have the toggle rule change the game's internal settings about how room descriptions are displayed. (See the example attached for further guidance.)

It is only useful for a given option to have one of these three features -- a description or a subtable or a toggle element. In the event that more than one column is filled out, the game will obey the toggle rule in preference to creating a submenu, and create a submenu in preference to displaying description text.


A
 Example Tabulation

A simple table of hints and help (see also Basic Help Menu).