I7 Howto remove Informs paragraph breaks?

Inform uses paragraph breaks to seperate location description and the description of objects in said place, and also to seperate the command prompt from whatever text is printed before (but not after) the prompt. Like this:

I think this choice on how to use paragraph breaks are inspired by some sort of standard for console input. But I find it a bit confusing, and would prefer if the paragraph breaks were used solely to seperate the users input and the games reply:

So, the big question: Is there a way to remove the paragraph breaks from the games reply?

You could try using the extension Single Paragraph Description by Emily Short. (Download it and Room Description Control from the Public Library if the Public Library works for you, install them both if necessary, and start your source file with “Include Single Paragraph Description by Emily Short.”)

Thanks, but that one doesn’t seem to be working:

It looks like you don’t have the latest version of Room Description Control; version 12 (available here if you can’t download it through your Inform application) has changed “consider the ranking rules for the output entry” to “follow the ranking rules for the output entry.”

(There used to be a very subtle difference between “consider” and “follow,” but some changes in Inform a few versions back eliminated the difference, so “consider” has been dropped in the latest versions of Inform.)

You could see if updating Room Description Control fixes the other problem. (I haven’t installed the latest version of that extension so I can’t check myself.)

Thanks! You’re right - I was using an outdated version (since I couldn’t locate it on inform7.com/write/extensions/ I just googled it and ended up finding an old version)

Now it works, but It looks like the extension has some small quirks - it ignores this line:
Rule for writing a paragraph about Barffy: say “Gebah!”.
It also lists the butterfly Barffy is wearing as if it were just lying around, forgets to mention that the key is lying on a table, and “you also see here” sounds kind of clumsy:

You are in a large area surrounded by a circular stone wall. Barffy is standing here, looking kinda mean. You also see here Gobba, a butterfly, a table and a red key.

Yeah, that’s unfortunate. Looks like the extension might not do what you want without a lot of hammering. Sorry that this suggestion was unhelpful. It doesn’t look easy to do this, at least not in my current insufficiently rested state; maybe you could use the code for the extension as an inspiration to get this to work better.

The issue here, I think, is that text produced by different rules usually gets put in different paragraphs. See section 5.8 of Writing with Inform. You can often override this by writing “[run paragraph on]” at the end of the text, but in the text produced by the looking rules it’s hard to make sure that a “run paragraph on” occurs in all the right places. That’s presumably why the Single Paragraph Description extension throws out the main looking rules and replaces them with different ones that run the paragraph on where necessary. So there’s no really simple solution here.

Okay, still not any closer to a solution, but now I have a good idea why! :slight_smile: I think I’ll just accept those paragraph breaks. Re-wirering the basic mechanics of Inform just to remove some line breaks is a bit much!

Or, one dirty hack might work: Is it possible to capture the games “reply”, and then replace the “[line break]” with " " and then print that instead?

Not to be too discouraging, if you don’t want to rewire the basic mechanics of Inform you probably really don’t want to do that. There’s an extension called “Text Capture” by Eric Eve that lets you capture printed text but it seems like pretty heavy lifting (I’ve never used it directly, though there are some extensions for hyperlinks that exploit it).

What about editing the Standard Rules to eliminate line/paragraph breaks in some specific places, like the room heading description rule (or whatever it’s called)? Remove the ones you don’t want, keep the ones you do. Wouldn’t that work? (Just keep a copy of the proper Standard Rules handy, of course)

That’d ordinarily be what I’d try, but the standard room description body text rule ends with a call to “print the location’s description,” and print the location’s description calls an I6 routine. So it’s not easy to find a place to insert a [run paragraph on] there, at least not as easy as if it were an I7 rule; and I’m not sure how you’d go about rewriting the rule in I7.

But that’s all that rule does, print the description. If the author doesn’t put any line breaks there then any won’t be printed.

OK. Merely omitting line breaks in the description isn’t sufficient; this code:

Plateau is a room. "Here's the plateau.[run paragraph on]". A rock is in plateau.

puts in a line break even though the room description runs the paragraph on.

But if we change the call to “print the locations’ description” in the room description body text rule, we can insert a run paragraph on there, and then we won’t get the line break:

[code]Plateau is a room. "Here’s the plateau. ".
A rock is in plateau.

Carry out looking (this is the new room description body text rule):
if the visibility level count is 0:
if set to abbreviated room descriptions, continue the action;
if set to sometimes abbreviated room descriptions and
abbreviated form allowed is true and
darkness witnessed is true,
continue the action;
begin the printing the description of a dark room activity;
if handling the printing the description of a dark room activity:
now the prior named object is nothing;
say “[It] [are] pitch dark, and [we] [can’t see] a thing.” (A);
end the printing the description of a dark room activity;
otherwise if the visibility ceiling is the location:
if set to abbreviated room descriptions, continue the action;
if set to sometimes abbreviated room descriptions and abbreviated form
allowed is true and the location is visited, continue the action;
say “[description of the location][run paragraph on]”.

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

The only difference between the new room description body text rule and the one in the standard rules is the last line, which is subsituted for “print the room’s description.” Note also the space at the end of the room description.

Maybe we can do this by sprinkling “run paragraph on” at the end of enough rules. There’s a trick for writing a paragraph about, though; if the text you print ends with “run paragraph on” then apparently Inform pretends that no text has been printed, which in a rule for writing a paragraph about means that the objects named in the paragraph don’t get counted as mentioned. So if you want to write a rule for writing a paragraph about Jenny it has to look like this:

Jenny is a woman in Plateau. Rule for writing a paragraph about Jenny: say "Jenny is here, spinning. [run paragraph on]"; now Jenny is mentioned.

because if you omit “now Jenny is mentioned” you get:

(“No line break” doesn’t work either; it gives you a line break with no white space.)

But this might be more feasible than the Single Paragraph Description extension, which doesn’t look like it gives you all the functionality of the standard looking rules.

I noticed a little oddity. FYI, with your code, if the room doesn’t have an object, the command prompt will print next to the text instead of it being in a new line.

Shows how hacky this sort of proposition can be. Certainly much more than I originally thought.

BTW, when tackling this on my own I accidently replicated your code. So we were thinking on the same lines, which is nice.

Oh yeah, if the last thing you print ends “run paragraph on” that’ll happen. If you really want to do this up properly you need… well, probably the simplest thing to do is make sure everything in the look rules runs the paragraph on and then use an After looking rule to print a paragraph break (and continue the action so anything else you need to happen gets done, maybe). This probably produces too much space if there’s a room with a blank description but you could take care of that by not having any rooms with blank descriptions.

Anyway my code is only a start.