Removing the name from a dark room [i7]

When the player is in the dark in I7, the default room title is ‘Darkness’. This title is stored as misc library message 71, says Ron Newcomb’s Default Messages extension.

What I want to do though is just not have a room title printed in the main window when in the dark. The best I could do was turn it into a line break, by having a say phrase with an ‘ignore library line break’ instruction included in it. The say phrase is needed because the same library message is printed by Exit Lister when in the dark, but up there in the status line, I do want it to say something else of my choosing. Of course the Exit Lister angle is probably easy to fix in itself.

However in the main window, I haven’t been able to completely eliminate the title of the dark room. What I’m nitpickingly trying to do is remove even the line break I’m getting so that there aren’t 2 blank lines appearing between blobs of output each time one moves in the dark…

  • Wade

I don’t have code handy, but it should suffice to delist the “room description heading” rule and replace it with a custom version. (Original is in the Standard Rules.) Gussy it up to do nothing when in the dark.

How about this:

[code]Sunny is a room. Night is west of Sunny. Night is dark.

Carry out looking when the visibility level count is not 0 (this is the new room description heading rule):
say bold type;
if the visibility ceiling is the location:
say “[visibility ceiling]”;
otherwise:
say “[The visibility ceiling]”;
say roman type;
let intermediate level be the visibility-holder of the actor;
repeat with intermediate level count running from 2 to the visibility level count:
issue library message looking action number 8 for the intermediate level;
let the intermediate level be the visibility-holder of the intermediate level;
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]

I often kill extra line-breaks by inserting [Run Paragraph On] into a string, but it doesn’t work with everything, and sometimes (not consistently) it’s necessary to pair it with an immediate line-break (if it consumes two line breaks instead of one) … and the entire kludge is irrelevant to … indexed text? I think? I just know that line breaks are the source of 50% of my frustration in i7 and I just keep flinging random stuff at them until they stop making me want to scream :slight_smile:

That probably wasn’t helpful at all, but typing it helped me wake up.

Or perhaps:

[code]Carry out looking (this is the sometimes room description heading rule): if in darkness, do nothing; otherwise consider the room description heading rule.

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

You can also use “when not in darkness” here, like so.

[code]Carry out looking when not in darkness (this is the new room description heading rule):
say bold type;
if the visibility ceiling is the location begin;
say “[visibility ceiling]”;
otherwise;
say “[The visibility ceiling]”;
end if;
say roman type;
let intermediate level be the visibility-holder of the actor;
repeat with intermediate level count running from 2 to the visibility level count begin;
issue library message looking action number 8 for the intermediate level;
let the intermediate level be the visibility-holder of the intermediate level;
end repeat;
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]

You can also write it like this.

[code]Carry out looking when not in darkness (this is the sometimes room description heading rule): consider the room description heading rule.

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

Also, if you want to remove “Darkness” from the status line as well, you can do so with this.

[code]Include (-

[ SL_Score_Moves;
if (not_yet_in_play) return;
#ifdef NO_SCORING; print sline2; #ifnot; print sline1, “/”, sline2; #endif;
];

[ SL_Location;
if (not_yet_in_play) return;
if (location ~= thedark) {
FindVisibilityLevels();
if (visibility_ceiling == location) print (name) location;
else print (The) visibility_ceiling;
}
];

-) instead of “Status Line Utilities” in “Printing.i6t”.[/code]

Hope this helps.

Thanks all. Helping me isn’t a contest, but if it were, I guess Felix won this round with his 2 line solution :slight_smile:

I’ll have to remember that combo… replace the original rule with an ‘IF’ junction which can consider the rule. That is a very cool trick.

Ghalev - I know what you mean about throwing things at line breaks. I’m now on top of all the regular behaviour, but every now and then - usually where hardcoded stuff like this darkness routine is involved - that’s where it gets tricky. And yeah, I also try wielding the run paragraphs on and the ignore library line breaks, etc, and sometimes they will do the trick.

  • Wade