[I7 solved] Lumping people together in different paragraphs

I wrote some sample code, and I think I got most of it to work but not all of it.

[code]“8thgradedance” by Andrew

printing room nonsense is an activity.

a procedural rule: ignore the room description paragraphs about objects rule.

rule for printing room nonsense:
if number of visible men > 0:
say “You see [list of visible men] huddling on the left by the cookies.”;
otherwise:
say “Nobody is hanging near the cookies.”;
if number of visible women > 0:
say “You see [list of visible women] huddling on the right by the punch bowl.”;
otherwise:
say “Nobody is hanging near the punch bowl.”;

carry out looking (this is the room description lump guys rule):
begin the printing room nonsense activity;
if handling the printing room nonsense activity:
say “2”;
end the printing room nonsense activity;

High School Gymnasium is a room. Alex is a man in high. Debbie is a woman in high. Billy is a man in high. Erica is a woman in high. Chuck is a man in high. Frannie is a woman in high.

the punch bowl is in high. the punch bowl is fixed in place. the cookies are in high. the punch bowl is fixed in place. the tacky party hat is in high.[/code]

Now, I’m pleased with myself for splitting groups of people into different paragraphs–but there are some definite problems going forward.

First, I’m totally clueless WHY “if handling the printing room nonsense activity” is needed. But it is. I’ve basically parroted from the Standard Rules til I got what I wanted. Should I be using an extension for this to make it easier? I’ve looked at them and don’t see how to use them for this. What examples/docs should I study to make this clearer to me?

Second, the party hat is not displayed. My procedural rule seems too sweeping. What can I do to tone it down?

Thanks!

It would seem that “if handling the nonsense activity” actually means “unless there are any for rules for the nonsense activity”!

So, it should only be used when you have not written any for rules for the activity (i.e. when, instead of writing for rules to be called from another rule, you rather put the behavior of the activity inside the very rule that activates the activity (not sure that last sentence made sense).)

If you want activities to run for rules (and before rules and after rules) in the normal way, use:

carry out looking (this is the room description lump guys rule): carry out the printing room nonsense activity.

EDIT: I suppose this is mainly to let extension writers introduce activities whose behaviour can be easily overruled by authors’ source code. The extension uses the if handling the nonsense activity syntax, and that becomes ineffective as soon as the game author writes a for rule for the nonsense activity.

You can attain the effect that I think you’re looking for much more simply using rules for writing a paragraph about. See 17.22: A rule for writing a paragraph about a thing, if it prints anything, will remove that thing and anything else that was mentioned (in brackets) from the list of things that get put in “You can also see” at the end. It’s basically designed to let you lump things together in the room description. Thus:

[code]Use American dialect and the serial comma.

High School Gymnasium is a room. Alex is a man in high. Debbie is a woman in high. Billy is a man in high. Erica is a woman in high. Chuck is a man in high. Frannie is a woman in high.

the punch bowl is in high. the punch bowl is fixed in place. the cookies are in high. the cookies are plural-named. the punch bowl is fixed in place. the tacky party hat is in high.

For writing a paragraph about a man in High School Gymnasium: say “You see [list of visible men] huddling on the left by [the cookies].”
For writing a paragraph about a woman in High School Gymnasium: say “You see [list of visible women] huddling on the right by [the punch].”
Rule for printing the name of the punch bowl while writing a paragraph about a woman in High School Gymnasium: say “punch”.

Definition: A person (called subject) is NPC if the subject is not the player.

A room called Outside the Gym is outside from High School Gymnasium. “There are a lot of dim bushes here.”
For writing a paragraph about a person in Outside the Gym:
if the number of visible NPC persons enclosed by Outside the Gym is:
– 1: say “[List of visible NPC persons in Outside the Gym] is here, looking disappointed to see you.”;
– 2: say “[List of visible NPC persons in Outside the Gym] are here, giving you a dirty look.”;
– 3: say “[List of visible NPC persons in Outside the Gym] are here, giving each other the fisheye.”;
– otherwise: do nothing.

A persuasion rule: Persuasion succeeds.
Test me with “out/in/Alex, go out/out/in/Billy, go out/out/in/Chuck, go out/out/in/Erica, go out/out”.[/code]

You can see that once more than three NPCs are Outside the Gym the rule does nothing, and everyone falls through to the “you can also see” rule.

EDIT: It slipped my mind that you were already mentioning the cookies and punch when you were describing the boys and girls, so I put them in brackets so they wouldn’t also wind up in the You can also see paragraph. And then I had to write the rule for printing the name of the punch bowl so it would be “punch” when you were talking about the girls but “punch bowl” when there weren’t any girls there.

Since your procedural rule suppressed the “You can also see” stuff completely, it was actually preventing anything about the hat, cookies, or punch from being printed. But you were already writing prose about the cookies and punch (which Inform didn’t recognize as being about those objects, not that it mattered in this case), so it wasn’t immediately apparent.

Awesome, thanks! I realized I was probably making this harder than it should’ve been, so the explanations are appreciated. I have a tendency to do that–but I should know by now that Inform -does- offer easy solutions even though they are hard to look for initially. Now that I think about it, and I poked around in the standard rules–yeah, there are safeguards against viewing something twice. Not sure why I assumed there weren’t.

Also, I appreciate the example back at me. Things are clicking now in terms of printing paragraphs.