Printing rule

Hey, i have a question about the printing rules. :frowning:

How can i stop printing the name of person in the output?

I did it like this:
“Rule for printing the name of Karl: print nothing.”

But then this appears when I enter the room where Karl is in:
“You can see , ball and hand here.”

I want it like this:
“You can see ball and hand here.”

You can say

Karl is scenery.

…although this changes some of the default failure messages, e.g. to PUSH KARL.

This also works:

Rule for writing a paragraph about Karl:
	now Karl is mentioned;

Is there a difference between “print nothing” and “do nothing” - do nothing might remove the comma if I’m guessing correctly that “print nothing” means “show a blank” rather than “do nothing” which would seem to mean “don’t do the whole process” that includes the comma?

Mere speculation on my part.

A printing-the-name rule cannot remove the comma in a list of objects. Once you’ve got as far as printing the name of the object, the list writer has already decided what the list contains and where to put the commas and "and"s.

To riff on Zarf’s suggestion, you can define Karl as “undescribed,” which will cause him to be left out of room descriptions (like scenery) but won’t change any of the responses.

“Undescribed” has other side effects. Avoid it if possible.

What are these side effects?

Thank you for your help. I did it like this:

Before listing nondescript items: if Karl is marked for listing: now Karl is not marked for listing;

It works fine for me.

But I have another problem now :smiley:

If the player does something except one special action (like opening the door), how do i write that?

After doing something: if the action was not opening the door: now....;

This surely doesn’t work :smiley:

You should be able to write “if the current action is not opening the door:”.

In this case, though, you really want to put the condition in the header of the rule. Otherwise the “After doing something” rule will always fire… and “After” rules by default cut off the processing of the action before you get to the Report rules, so this will cut off even the processing of your special action. You could write:

After doing something when the current action is not opening the door:

or much more succinctly

After doing something other than opening the door:

See Section 7.9 of Writing with Inform. (Also, you might want to put some other restriction on the rule, because I’m not sure you’d really want this to happen when someone does absolutely anything other than opening the door in the entire game.)

I don’t remember off the top of my head. I always have to grep through the library source to find all the tweaky details.

(And that’s why I don’t recommend using it, right.)

Thank you for your help, but it cuts off other After rules like you said.

Every turn: if the player is in room: After doing something other than opening the door: now the relay is switched off;

So how do I have to sort it?

Okay i got my mistake. I just forgot to add “continue the action”.

Don’t put an After rule inside an Every turn rule. Those are two separate kinds of rule.

Using “After” and “continue the action” should accomplish what you want. “After” runs after the action so it’ll run for every action when the player accomplishes something other than opening the door.

Though it doesn’t run when the action gets cut off by an Instead rule, or a Check or Before rule that fails, so it won’t run absolutely every turn. If you want something that runs even on those failed actions, you could try this:

Every turn when the player is in the Lab: [you really want a specific room name here instead of "when the player is in room"] if the current action is not opening the door: now the relay is switched off.

Thank you very much, now everything works fine :slight_smile: