A4:Roomgroup

From IFWiki

A Roomgroup (or Room Group) is a collection of rooms in an ADRIFT game. There are only three ways to use them:

  1. To move a dynamic object to a random room in the roomgroup.
  2. To move either the player character or a non-player character to a random room in the roomgroup.
  3. To move a non-player character to a random adjacent room in the roomgroup from the character's current location, as part of the character's "walk" program. If there are no adjacent rooms in the roomgroup, the character is moved to a random room in the roomgroup.

Random movement of objects and characters are handled via Task actions. Character walks are defined as part of their Character definition.

Roomgroups are not used to place static objects, like grass, in multiple locations. Instead, in the object's dialog screen, just select the names of all the rooms where the object is supposed to be from the "Object exists in" list.

Roomgroups are only seen by the ADRIFT game's author; players do not see roomgroups.

In the unregistered version of ADRIFT Generator 4.00, the author is limited to 2 Roomgroups. After registering, the author may define as many roomgroups as he or she likes.

Roomgroups were first introduced in Adventure Generator 3.60 on February 7th, 2000. ("Adventure Generator" was ADRIFT's original name. ADRIFT wasn't called ADRIFT until version 3.70.)

Creating, Editing, and Deleting Roomgroups

Roomgroups are defined with the ADRIFT Generator's "Advanced" dialog. To open the Advanced dialog, either:

  • Click on the "Add Roomgroup" icon, or
  • Select "Advanced..." from the "Adventure" menu. If necessary, click on the "Room Groups" tab.

To create a new roomgroup, click the "Add" button. This opens the "Select Rooms" dialog, which is pretty straightforward. Just select the rooms you want in the group from a list. (Of course, you have to define some rooms first before you can select any.) The "Select Rooms" dialog is also where to give the roomgroup its name. Click "OK" when you're done editing the roomgroup; the roomgroup's name will be added to the list of roomgroups in the "Advanced" dialog.

To edit or delete a roomgroup, select the roomgroup's name from the list, then push the "Edit" or "Delete" button respectively.

Code Compare

ADRIFT's Roomgroup has no direct analog in most other IF authoring systems, although Inform 7's region kind is closest to the same idea. Other authoring systems usually allow their authors to define arbitrary lists of items, and they also provide various "loop" statements that can be used to iterate through a list. Since ADRIFT neither supports arbitrary lists nor looping statements, the Roomgroup is a necessary but rather specialized workaround.