Writing a paragraph about, locale priority, etc

A few things I’ve noticed while messing with these activities:

First, if you write an “after writing a paragraph about” rule, it appears it will always trigger, whether or not there is a paragraph to write. For instance, if your rule is:

After writing a paragraph about a person while the location is the garden: say " [It-they] meanders about aimlessly."

Then for any person without a description, it will simply print “He (or she) meanders about aimlessly.” Is there a way to append something to an object’s paragraph only if the object in question actually has a paragraph (and otherwise treat it as a normal nondescript object)?

The second thing I noticed is that, unless I’m doing something entirely wrong (which cannot be ruled out), locale priority doesn’t seem to influence the order in which paragraphs print. Is this so?

(Apologies if I’ve made any code mistakes; I’m away from my Inform machine.)

I think what happens is the “writing a paragraph about” activity is carried out with every mentionable object. If the “for” rule succeeds, then the object is marked as mentioned. Perhaps you could check if the object is mentioned in your “after” rule? I’m not sure if this would work, but it’s worth a try.

In my experience, I haven’t found “before” and “after” activity rules to be very good at printing text. There’s always something going on beyond the scope of the rulebook that makes them not quite what I wanted. “After” activity rules, however, are useful for modifying default behavior (as in choosing notable locale objects) and timing things optimally (as in reading the player’s command).

I don’t believe that is so - I’ve been using it successfully. Perhaps you could post an example - it’s possible that just coming up with an example will reveal to you what’s going on.

The behavior is odder than I originally thought. The “after” rule actually obliterates the paragraph that would otherwise be printed, just like an “instead” rule. Even if you include “continue the action.” Including an “if it is mentioned” clause makes the rule never trigger; “if it is not mentioned” always triggers.

[code]After writing a paragraph about a thing (called N):
if N is mentioned:
say “It is near you.”;
continue the action.

The classroom is a room.

The desk is a supporter in the classroom. “There’s a desk here.”

The ruler is in the classroom.[/code]

(You’re right, the second problem does actually work properly.)

Well, this seems to me as though it’s working in accord with the way the activity is described in 17.22, which says:

Which means that, even if you wrap something in an “After writing a paragraph about” rule, that rule will still fire before the paragraph gets written, and will still obliterate your paragraph.

So that looks like it doesn’t work as a hook for you. I think that the thing to do might be to put a new rule in the “For printing a locale paragraph” rulebook, but I can’t actually get the spacing working very well. The following succeeds in printing “It is near you” after the initial description of the desk (and only the desk), but it’s in its own paragraph and looks fugly, and adding [run paragraph on] to the desk’s initial appearance didn’t do anything. Other people might have a better idea.

[code]The classroom is a room.

The desk is a supporter in the classroom. “There’s a desk here.”

The ruler is in the classroom.

Last for printing a locale paragraph about a thing (called the item) (this is the add a paragraph rule):
if the item is mentioned and the item is not undescribed:
say “[The item] is near you.”;
continue the activity.[/code]

UPDATE: No, this isn’t good – it runs even on scenery. We could include a check for scenery, but I have no confidence at all that that would catch all the cases.

Bluh. If it were me, I’d probably just rewrite the use initial appearance in room descriptions rule and describe what’s on scenery supporters in room descriptions rule so this rule was appended to it, since those seem to be the only standard printing a locale paragraph rules that actually print anything; and then if I had any new printing a locale paragraph rules I’d add something else to them. But I think you need better advice from someone else. (Also, if you could post a bit of what you’d like your output to look like, that could help.)

Ah, you’re using initial appearance properties, not “for writing a paragraph about” rules. Kind of explains the difference between the writing a paragraph about activity and the printing a locale paragraph about activity. I was always confused by the latter.