report examining the player:
say "1.";
continue the action;
report examining the player:
say "2.";
continue the action;
report examining the player:
say "3.";
continue the action;
It will print “As good looking as ever.\n\n1.\n\n2.\n\n3.” (e.g. extra line break.) If I change report to after, same thing.
I’m not seeing this with printing the locale description.
after printing the locale description:
say "1.";
continue the action;
after printing the locale description:
say "2.";
continue the action;
after printing the locale description:
say "3.";
continue the action;
This prints “Description.\n\n1.\n2.\n3.” and does not, as I would expect, put a space between the 1/2 and 2/3. How would I allow for this extra space other than to have
after printing the locale description (this is the initial afterprint rule):
now break-before is false;
continue the action;
to say bb: if break-before is true:
say "[line break]"
to say bbset: now break-before is true;
after printing the locale description (this is rule 1):
if score > 10, say "You're doing really well.";
continue the action;
after printing the locale description (this is rule 2):
if player has the thingummy, say "[bb]Your thingummy glows.";
continue the action;
? This is doable but seems trickier than necessary.
Ideally I’d like to provide the additional line break in rule 2 if and only if rule 1 fires. Is there a way to define rules or line break settings? Thanks!
Maybe there is some Mad Scientist solution that could address the mechanism of what happens at the end of printing the locale description in general. (Which I can’t provide!)
I do suspect it’s to do with the locale description machinery, or less likely, the after rule machinery. As in, I don’t think it’s the Report machinery.
I have noticed that some entities, like the description of a thing, do not produce a concluding line break if you print them manually.
e.g. If the description of the apple is ‘It’s red.’ , X APPLE produces ‘It’s red.(nice line break).’ But if you access the description yourself, like ‘say description of the apple’, you do not get the end line break and need to provide it yourself. I wonder if your issue is in the same ballpark.
That said, I face similar issues all the time. I find it’s easy to handle if I know that at least one thing will be printed. Then I just end every optional print statement with ". " (period space). Now every printed line is attached to the previous, and every line is trailing. And at the end I manually print one line break to end it.
If I don’t know if even one thing will be printed, then I have resorted to temp-variable flags (PRINTED-YET), not dissimilar to your bb solution. But your situation is potentially ickier because the things you’re printing aren’t together in the same rule. Have you considered putting them in one rule? I’m guessing you wouldn’t want to.
A Mad Science solution may end up solving this cleanly, but I find the trailing line approach is a pretty good one in general.
Printing: paragraph control (this is from I7 9.3/6M62, not the current version, 10.1.2 but this description still holds):
The basic method is to set say__p, the paragraph flag, when we print any matter; every so often we reach a “divide paragraph” point – for instance when one rule has finished and before another is about to start – and at those positions we look for say__p, and print a skipped line (and clear say__p again) if we find it. […]
A divide paragraph point occurs between any two rules in an action rulebook, but not an activity rulebook: many activities exist to print text, such as the names of objects, and there would be wild spacing accidents if paragraphs were divided there. [emphasis added]
Printing the locale description of something is an activity, not an action.
(The I7 compiler will balk if you try to usecontinue the activity or continue the action outside of:
a rule
a to say [...] phrase
a to [...] phrase (not including to decide if/whether [...])
…but it has no problem with continue the action within an activity’s rule (or vice-versa); either one just translates to rfalse in Inform 6.)
Yourself can be thoughtful or thoughtless.
instead of jumping, now the player is thoughtless.
instead of thinking, now the player is thoughtful.
To decide what number is paragraph-flag: (- say__p -).
To decide what number is paragraph-completed-flag: (- say__pc -).
The printing the locale description activity has a number called paragraph-flag-cache.
to say br: (- new_line; -).
after printing the locale description when the player is thoughtless:
say "1.";
continue the activity;
after printing the locale description:
now paragraph-flag-cache is paragraph-flag;
say "2.";
if paragraph-flag-cache is not 0, say br;
continue the activity;
after printing the locale description:
say "3.";
continue the activity;
Lab is a room.
test me with "think / look".
We’re relying on say__p as a proxy variable indicating whether #1 ran, so this approach requires that:
say__p is 0 at the end of for printing the locale description (which is expected: printing paragraphs via invocations of the printing a locale paragraph about activity or (perhaps) the you-can-also-see rule is what it does)
if #1 runs, it produces output (which it does here)
nothing besides #1 can produce output between the start of the after printing the locale description rulebook and #2