the lab is a room.
The ball is in the lab.
The box is in the lab.
The triangle is a thing.
report taking when the noun is the triangle (this is the triangle taking rule):
do nothing;
The triangle taking rule is listed after the standard report taking rule in the report taking rules.
lab
You can see a ball and a box here.
> take all
ball: Taken.
box: Taken.
>
Why the extra space between ball and box? This seems to happen whenever I insert a rule at the end of the report taking rulebook. I can understand that there might be special line spacing rules for the end of a turn sequence rulebook, but why does it matter which rule is last?
However, isn’t there an inherent contradiction, with Inform’s way of doing things, in forcing a more specific rule to be listed after a less specific one in the same rulebook? That ‘when’ clause on the triangle rule vaults it so it will be considered before other less specific reporting rules that don’t use a ‘when’ clause. I’m not even sure how Inform handles this situation, where the more specific rule has been explicitly positioned in a rulebook.
Mind you, in my own style I use almost zero report rules.
EDIT PS - I hadn’t even thought before about whether using a when clause which just specifies the noun, and could therefore also be written as (action) (noun) without ‘when’, is the same thing as the (action) (noun) version in terms of automatic placement in a rulebook.
Yeah it is unusual in that sense. However, this gives the same results:
the lab is a room.
The ball is in the lab.
The box is in the lab.
The triangle is a thing.
report taking (this is the triangle taking rule):
do nothing;
The triangle taking rule is listed after the standard report taking rule in the report taking rules.
As background, I’m attempting to annotate some take reports with notes about what the player has just taken. That means it goes after the standard report taking rule. Well, it could be done other ways, but I feel like they’re messier.
If you look at the way a rulebook is constructed at the I6 layer, you’ll see that it’s a series of calls to the routines that implement particular rules. Between those calls to the rule routines, you’ll see a line like this:
if (say__p) RulebookParBreak(forbid_breaks);
The say__p global tracks whether any output to the screen has been printed by something generated from the I7 layer. It is set by any say... statement that outputs text, such as (in this case) the standard report taking rule’s “Taken.”
The RulebookParBreak() routine’s job is basically to print a new line if say__p is set and there is nothing suppressing that printing, so normally it will result in a line break, as it does in your example.
One of the ways to skip automatic line breaks of this type is setting a bit in the bit flag array say__pc. That’s what the code from zarf does. The whole bit flag array is reset on an automatic basis quite frequently, so the effect of setting it is usually short-lived.
The line above is only inserted between rules, so for a single-rule rulebook you won’t see them. When you add a second rule, the check will happen between the first and second rules regardless of whether or not the second rule produces output or is even applied.