Making room descriptions flow better?

I confess I am not a fan of the default room descriptions in inform, Like this…

and would like to change it to a more book like (or even Zorkish) style.

I’ve had a look at the manual and the various extensions (such as mentioned in room descriptions) and can see how to turn the relevent rules off but am well and trully stuck when it comes to rebuilding the rules into a form that I am happy with.

I dont know what Inform calls; The room, the rooms description, items in the room or items that are in items that are in the room etc. The fact we are currently chained down probably means playing with the rooms/players scope moving everything outside of it - or is there a touch distance? - but for now just getting rid of all those brackets would be a good start.

Could someone suggest or point me at a simplish explanation as to how inform builds the description and what I need to [say] to get at the relvant bits? the main thing I am trying to avoid is if statement itus where every action and every room is swamped by specific if this then do this.

Thanks in advance.

You may want to have a look at Jeff Nymans’s guide to I7 locale descriptions: http://zurlocker.typepad.com/files/nyman—inform7-locale.pdf.
And,for the details of it,see chapter 3 of ”Appendix A” (i.e. the commented version of the Standard Rules) : http://inform7.com/sources/src/stdrules/Woven/A-sr3.pdf.

Many thanks for this. Jeff’s guide is useful, but unfortuantly starts talkng about the Room description control extension just at the point I was hoping he would start showing how to build on the previous sections and show how to change the room descriptions yourself. I avoided Emily’s extension as it just looked too complex and hoped that by re-building just some of the description functionality I would learn inform quicker and save myself grief when it comes to more complex puzzles (such as having to put a box in a particular part of a room) so ypu can stand on it.

The commented version of the standard rules, while perhaps useful to someone famillier with inform are too low level for me to understand. (a bit like a Pascal prgrammer suddenly being told to write in Z80… I know I had to and still have the scars).

So so far I have gleaned that I can stop some of the brackets in the you can also see list thus;

rule for printing room description details for a closed container: stop.

Which stops … a chest (closed) … I thought that changing ;closed’ for empty would stop … a chest (empty) but it errors out on me. complaining that an empty container is not an object -huh? A close containers an oject but an empty one isn’t? How so? Confusion reigns.

Jeff talks about lists of non descript items, but doesn’t elaberate so he shows how to list something for a specific room, but not for any room - list the contents of the Hall words but list the contents of the printed name - or (printed name), [printed name] etc errors. Annoying when printed name is the name of the room.

So this is my level of bafflement. I just to not know how inform refers to simple things in code. I don’t know what it calls the current room, I don’t know why a closed container is an object, but an empty one isn’t I just cant figure the logic. No wonder I hated Cobol.

Has anyone produced a list of how Inform refers to internal things - like rooms, lists, empty containers?

In hope…

This is what the IDE Index tab is for.

This works fine. Are you saying that you want to have something similar for empty containers?

You can, but there is no definition of “empty” for container in the Standard Rules. This is where you really do wind up reading them… or you can look at the Phrasebook tab in the Index in the IDE. It shows that “empty” is defined as term for text, tables, rulebooks, activities, and a few other data structures. But not containers.

(Why not? I dunno.)

You can write the rule you want like this:

Definition: a container is empty rather than non-empty if it contains nothing.

Rule for printing room description details for an empty container: stop.

Or, if you’re curious how to do it without an “empty” definition:

Rule for printing room description details of a container (called C) when C contains nothing:
	stop.

Many thank for this Just what I needed. Re the index tab if this is part of the Mac/Windows/Linux app then I’m stuck as I write on an android tablet and test using Playfic. There isn’t an ide for Android yet uness you root the tablet, install Linux and then compile one. Oh well.

The simplest way to do this would be to use a “for writing a paragraph about” rule. See “17.22. Writing a paragraph about” in The Inform Documentation for more details.

Hope this helps.

Hi,

Many thanks for the suggestion, however the writing a paragraph about rule occurs after the header is produced and just before the interesting items are listed, so I don’t think this will help with getting rid of the (on the bed) stuff in the header(?).

In the meantime and I confess in a bit of despration I copied the whole of the looking section from the standard rules and changed it to gawping. I also amended the rule names to say new - so (this is the new room descriptin heading rule) and changed the variable names. My hope was to get gawp to work the same as look and then be able to play around with gawp until I got something I was happy with. Problem is it wont compile.

At the top of the standard rules is this.

The looking action has an action name called the room-describing action.
The looking action has a truth state called abbreviated form allowed.
The looking action has a number called the visibility level count.
The looking action has an object called the visibility ceiling. 
Setting action variables for looking (this is the determine visibility ceiling rule):
     if the actor is the player, calculate visibility ceiling at low level;
     now the visibility level count is thev isibility ceiling count calculated;
     now the visibility ceiling is the visibility ceiling calculated; now the room-describing action is the looking action.

Which I changed to…

The gawping action has an action name called the room-desc action.
The gawping action has a truth state called abb form allowed.
The gawping action has a number called the vis level count.
The gawping action has an object called the vis ceiling.

Setting action variables for gawping ( this is the determine vis ceiling rule):
	if the actor is the player then calculate vis ceiling at low level;
	now the vis level count is the vis ceiling count calculated;
	now the vis ceiling is the vis ceiling calculated;
	now the room-desc action is the gawping action.

So basically (I thought) changing the varous variables etc so that I didnt get dupliciate definitions. I must have stuffed up somewhere - but cant find where as the errors are;

if I change vis ceiling back to visibility ceiling that I loose the compile error - but my rules use vis ceiling. I think that its to do with the word calculate (is this calling a function?) but cant find anything about it in the standad rules.

Hope someone key pont me the right way.

It’s actually the phrase “calculate visibility ceiling at low level” that is calling a function. That’s defined elsewhere in the Standard Rules as a call to a bit of I6:

To calculate visibility ceiling at low level: (- FindVisibilityLevels(); -).

As are the phrases involving “calculated”:

To decide which number is the visibility ceiling count calculated: (- visibility_levels -). To decide which object is the visibility ceiling calculated: (- visibility_ceiling -).

So the words “calculate” and “calculated” aren’t doing any work here – it’s the whole phrase. One could replace it with something like this:

[code]To foo:
(- FindVisibilityLevels(); -).

To decide which number is the bar:
(- visibility_levels -).
To decide which object is the baz:
(- visibility_ceiling -).[/code]

And if you replaced all the calls to them with “foo” “bar” and “baz” it’d be the same. But much less comprehensible.

My advice is not to mess around with an all-new action and “vis ceiling” like this. If the issue is that you want to get rid of “(on the bed)” you can just change the room description heading rule. It’d look something like this:

[code]Carry out looking (this is the new room description heading rule):
[your rule here]

The new room description heading rule is listed instead of the room description heading rule in the carry out looking rulebook.[/code]

And I think what you want is this:

[code]Carry out looking (this is the new room description heading rule):
say bold type;
if the visibility level count is 0: [we are in darkness]
begin the printing the name of a dark room activity;
if handling the printing the name of a dark room activity,
issue miscellaneous library message number 71;
end the printing the name of a dark room activity;
otherwise if the visibility ceiling is the location: [we are in a room]
say “[visibility ceiling]”;
otherwise: [we are in an opaque lighted enterable container]
say “[The visibility ceiling]”;
say roman type; [and the omitted stuff here about “intermediate level” is where it runs through all the supporters/containers you may be on and prints them in parentheses]
say line break;
say run paragraph on with special look spacing.

The new room description heading rule is listed instead of the room description heading rule in the carry out looking rulebook.[/code]

Hi,

Many thanks for this its very helpful. By playing around a lot with your code and reading on the net I’ve ended up with;

[code]The room description heading rule is not listed in the carry out looking rulebook.

The first carry out looking rule (this is the room description heading with enclosures rule):
if in darkness:
say bold type;
say “Darkness”;
say roman type;
otherwise:
say bold type;
say location;
say roman type;
[/code]

Which has so far worked.

I’m now sorting out the listing of nondescript items and have got this code so far;

Rule for listing nondescript items of the room (called the place): say "You can also see "; list the contents of the place, as a sentence, listing marked items only; let count be 0; repeat with thingy running through containers inside place: if thingy does not contain nothing: say "[line break]The [thingy] contains "; say contents of thingy; repeat with thingy running through supporters inside place: if thingy does not hold nothing: list the contents of the thingy, as a sentence, prefacing with is/are, including contents, and giving inventory information; say "."

This sort of works for containers and fails badly for supporters. What I want to be able to do is put things in and on top of other things and have them reported down to a sencible level. So supposing we have a crate on top of a chair on top of a table and there is an apple in the crate I would like to list something like;

You can also see a crate which is resting on top of a table and this is standing on top of a table.
There is an apple in the crate.

or

You can also see a table, there is a chaiir on the table and a crate on the chair.
There is an apple in the crate.

What I am getting though is a list of all the marked for listing things in the location (including youself) and cannot figure how to run through the list of containers/holders (and the holders of holders, holders of containers etc) without cauing the coding equivelent of a blackhole (and a headache).

Could someone point me in th right direction?

I’ve had a rethink on this and am now working on a way to change the notable objects to try and get things like the players container/ supporter split out. The below code sort of works but I am getting 3 odd problems.

1 If a player starts on an object that also has others on it then for some reason the part relating to being on a supporter gets executed saying 'with you are (whatever is on the supporter) even if you are not. so say you start laying on a bed with a towel and a pillow. You then get off the bed, but look still prints ‘With you are a towel and a pillow.’ and I have no idea why!

  1. This gets executed at the end of a carry out looking somehow if you are on or in something as I get the 'You are … " message after the list of non descript items. Again confused.

  2. When you are in or on something I get what looks like an exmine message like - In the crate you can see a bottle. Once again no idea why.

Hope someone can help.

after choosing notable locale objects (this is the barf rule): repeat with thingy running through objects in location: let cont be 0; let cont2 be 0; let first-desc be the initial appearance of thingy; if thingy is a container: let cont be the number of objects in thingy; repeat with dooda running through objects in thingy: now the dooda is marked for listing; if the player is in the thingy: decrement cont; say "You are [the posture of the player] in "; if first-desc is not "": say first-desc,"."; otherwise: say "a ", thingy,"."; set the locale priority of the thingy to 0; if thingy is a supporter: let cont be the number of objects on thingy; repeat with dooda running through objects on thingy: now the dooda is marked for listing; if the player is on the thingy: decrement cont; say "You are [the posture of the player] on "; if first-desc is not "": say first-desc,"."; otherwise: say "a ", thingy,"."; set the locale priority of the thingy to 0; now the player is not marked for listing; if cont is greater than one: if thingy is a container: say "Beside you "; list the contents of the thingy, as a sentence, listing marked items only, prefacing with is/are, including contents, and giving inventory information; say "."; if thingy is a supporter: say "With you "; list the contents of the thingy, as a sentence, listing marked items only, prefacing with is/are, including contents, and giving inventory information; say "."; now the thingy is not marked for listing;

Hello again,

Well I continue to struggle on this problem. My latest effort is below;

[code]things can be listed or not listed. things are usually listed.

[below resets the not listed flag so all objects are described]
before printing the locale description of something (called the thingy):
now the thingy is listed;

rule for printing a locale paragraph about something (called the thingy):
let l be a list of things;
let levelcount be the visibility ceiling count calculated;
let ilevel be the visibility-holder of the player;
if thingy is ilevel and thingy is listed:
say “You are [the posture of the player]”;
let itter be 0;
repeat with ilevelcount running from 2 to the levelcount:
if itter is greater than 0, say " which is";
if ilevel is a supporter, say " on ";
if ilevel is a container, say " in ";
let first-desc be the initial appearance of ilevel;
if first-desc is not “”:
say “[first-desc in lower case]”;
otherwise:
say "a ", ilevel;
let ilevel be the visibility-holder of the ilevel;
increment itter;
add ilevel to l;
[try to display items on the same level as the players supporter/container]
now thingy is not listed;
repeat with dooda running through l:
if dooda is not location:
if dooda is a container:
say "In the ", dooda, “with you [a list of the things that are in the dooda]”;
if dooda is a supporter:
say "On the ", dooda, "beside the ", thingy, “[a list of the things that are on the dooda]”;

[/code]

This is (at last) getting there, but trips up when it trys to list the items that are at the same level the players supporter/container is.

For example if you are in a box and the box is on a bed and there is a pillow on the bed I want to say -

You are sitting in a box that is on a bed. On the bed beside the box is a pillow.

The first part works, but the second lists all the items on the bed -including the player, the box and anything in the box.

The problem is that I do not know how to exclude things in [a list of the things that are on the dooda] - saying [a list of the things that are on the dooda excluding the player] errors out moaning about not understaning the player.

I have tried filling a list - so I can remove the player and then just list the list - but can’t work out how to auto fill a list

let l be a list of things on the dooda;

Errors out.

Any help greatly appreciated.