Improve your room descriptions in seconds with this one easy step!

By default, the way Inform arranges objects in a room description is seldom obvious. It involves the order things are defined in the source code, the order in which they’ve been moved during play, and the intricacies of the implementation of the going action. And lately I’ve been finding this less than ideal.

So here’s a solution!

To decide what number is the calculated priority for (the item - a thing):
	if the item is fixed in place or the item is scenery or the item is a door, decide on 1;
	if the item is a person, decide on 2;
	if the item is pushable between rooms, decide on 3;
	decide on 4.

Rule for choosing notable locale objects (this is the better notable locale objects rule):
	let the domain be the parameter-object;
	let the held item be the first thing held by the domain;
	while the held item is a thing:
		set the locale priority of the held item to the calculated priority for the held item;
		now the held item is the next thing held after the held item;
	continue the activity.

The standard notable locale objects rule does nothing.

Now, room descriptions will:

  • First mention things that are fixed in place
  • Then mention people
  • Then mention things that are pushable between rooms
  • Then mention things that are portable

Want to change this order? Just edit the calculated priority phrase! Lower numbers come first. (This one’s for a game with several pushable things, which is why they get their own section; most games probably won’t need that.)

17 Likes

Now what you are doing here sounds VERY familiar. I ran into the exact same problem: things moving around and I wanted to have some control over the order of things… it got a bit out of hand, though…

Rule for choosing notable locale objects:
	repeat with item running through things in the location:
		if the item is portable:
			if the item is a monster:
				set the locale priority of the item to 10;
			else if the item is an animal:
				set the locale priority of the item to 8;
			else if the item is a man or the item is a woman:
				set the locale priority of the item to 9;
			else:
				set the locale priority of the item to 6;
		else if the item is not a door:
			set the locale priority of the item to 5;
		else if the item is open:
			set the locale priority of the item to 7;
		else:
			set the locale priority of the item to 0;
3 Likes