Possible Glitch?

Instead of showing the wooden sword to Donald: say "'Such a weapon would do no good. [run paragraph on][if the metal sword is broken] Actually, it's the only weapon you have left![run paragraph on][end if]' says Donald."; say ""; now the wooden sword is shown.

The reason I put [run paragraph on] is that the system will automatically line break otherwise. And for the say “” line, if I don’t put that it will not skip the line before the next input.

Interestingly, this only seems to happen when showing something to someone. If I just have it as part of a normal say, as if “when play begins, say”, it doesn’t auto-line break.

Is it supposed to be like this? Is this a bug of some kind?

I’d call it a bug. The line spacing differs depending on whether the say phrase compiles to a string literal or to a function (text with substitutions compiles as a function). That shouldn’t be the case. I’d also call the line break that occurs at the exclamation point in mid-text a bug. Inform should know not to apply line-ending punctuation rules in mid-sentence.

[rant]By the way, you only need one of those "run paragraph on"s, the second one:

say "'Such a weapon would do no good. [if the metal sword is broken] Actually, it's the only weapon you have left![run paragraph on][end if]' says Donald." [/rant]

–Erik

EDIT: Oops, the ranted text is incorrect. The OP’s posted text had an undesirable space before the first “run paragraph on”; remove that space, and that run paragraph on is indeed necessary (though it shouldn’t be–again, it doesn’t make sense that Inform breaks lines automatically in this way).

Line breaks in Inform never happen where I expect them to. I’ve done a lot of work to break things up into rulebooks, and rulebooks seem to have particularly unpredictable handling of line breaks. I think there was a case where I moved some rules into their own section of the source, and the line break behavior changed. (that was before I got 6F95 - I haven’t tested it since then)

Historically, this has always been a problem with Inform. If you go back about ten years, you’ll find many I6 games with extra and missing line breaks. Those were easier for the author to fix, however, because I6 was a much simpler language. The number of constructions the author can devise in I7 is exponentially larger, so the library is called on to handle more odd cases.

The fact that text with substitutions compiles as a function … I didn’t know that, but it’s obvious now that you mention it. In I6 there was no such thing as a text substitution. You had to do it by hand. So I guess it’s not surprising that the added power of I7 produces some “edge cases” that still need tidying up.

–JA

The problem here is that you used “[run paragraph on]” where what you meant is “[no line break]”. WI 5.8 explains the difference: regarding “[run paragraph on]” it says, it prevents a paragraph break occurring after the present text is printed,'' where in this case the present text includes everything up to and includingsays Donald.’’

The interaction between rules and line breaks is also explained in that same section.