Ending in failure

Instead of going west while player is in Kitchen: if red door is open: say "West you go."; continue the action; otherwise: say "But the kitchen door is closed!"; stop the action.

Error message:

w
[going west]
[going west - ended without result]

Is this actually the rule that’s causing the failure?

Also, closed doors block the player’s progress by default. That’s built-in. You don’t need rules like this for every connection.

Here’s all the code that has to do with going west from the Kitchen:

[code]Instead of going west while player is in Kitchen:
say “[if kitchen door is open]West you go.”;
continue the action.

Instead of going west when player is in Kitchen:
if player does not wear robe:
say “You must be fully dressed to leave the kitchen.”;
otherwise:
continue the action.

Instead of going west when player is in Kitchen:
if player does not wear slippers:
say “You must be fully dressed to leave the kitchen.”;
otherwise:
continue the action.

Instead of going west when player is in Kitchen:
if player does not wear eyeglasses:
say “You’ll run into the wall if you can’t see.”;
otherwise:
continue the action.

Instead of going west from Kitchen:
if player holds towel:
say “You want to leave the kitchen carrying a dirty towel?”[/code]

Now, instead of saying going west ends without result, I7 just says it failed.

The problem is the “holding the towel” rule. This is one reason I like to use rule preambles for this sort of thing. If you say “instead of going west from the Kitchen when the player is holding the towel”, it won’t cause this problem if you forget to add a “continue the action” phrase.

I made the change, but going west still failed; in fact, the default say “You must be fully dressed to leave the kitchen.” printed out, as well. I can’t find the problem.

Instead of going west when player is in Kitchen:
say “[if kitchen door is open]West you go.”;
continue the action.

Maybe?

Tried that. Still fails. Still prints out the line about being fully dressed.

It seems to me right now that the “wearing” condition is the thing causing “go west” to fail.
Here is the relevant code:

[code]Instead of going west when player is in Kitchen:
if player does not wear robe:
say “You must be fully dressed to leave the kitchen.”;
otherwise:
continue the action.

Instead of going west when player is in Kitchen:
if player does not wear slippers:
say “You must be fully dressed to leave the kitchen.”;
otherwise:
continue the action.

Instead of going west when player is in Kitchen:
if player does not wear sleep hat:
say “You must be fully dressed to leave the Kitchen.”;
otherwise:
continue the action.[/code]

The ironic thing is that “inventory” reveals that all these items are being worn.

If you’re not sure which rule is causing the problem, you can try adding some unique text to each one so that you’ll know which one is printing the error message. For instance, you can just temporarily add a number or letter to “You must be fully dressed to leave the kitchen.”.

Or you can do what Draconis suggested and put the condition in the first line of the rule (for instance, “Instead of going west when player is in Kitchen and player does not wear robe”), then use the command RULES before you try going west. If the rule has a unique preamble, you’ll be able to tell which rule is running right before the response prints.

Ah, ha! Thanks!

Gets weirder and weirder. I did the “unique word” test above, and found I was failing on the first instance – “If player does not wear robe”.
So I changed the “Instead of going west” rule to “Check going west.”
What happened was that I was finally allowed to go west, even though I7 printed the same error message!
I guess I will just have to fool around with the code until things work as I intended them.
But does anyone have any idea of what is going on?

More puzzling stuff: I can’t seem to move the player from Room B to Room A.
Originally, I wrote an “instead” rule – “Check going north when player is in kitchen” – which ended in failure.
Then I changed the “instead” rule to a “check” rule. Now it ends “without result.”
Seems to me a simple movement command wouldn’t give trouble.
Any ideas?

“Check going north…” isn’t an Instead rule. I’m somewhat confused by your description. Could you post the actual code you used?

I would suggest ignoring anything Inform says about succeeding, failing, or ending without result until you get more familiar with how the different kinds of rules work. As section 19.11 of the documentation says, “‘success’ and ‘failure’ are technical terms here: they do not mean that the player has or hasn’t got what he wanted.”

What happened when the “instead of going west” rule was changed to a check rule is not surprising. An instead rule will stop the action unless you tell it to continue, but a check rule won’t stop the action unless you tell it to.

For the robe, I would suggest typing SHOWME ROBE and making sure the location says “worn by yourself in Kitchen”.

Draconis: I would post the actual code, but it probably would offend some people. I’m not really concerned with “robes” and “the kitchen,” though how the player is dressed is an issue.
In case I’m not being clear enough, it is a XXX game.

In that case I’d say copy the code into a text editor, then find-and-replace the sexual words to unrelated ones (which don’t need to make sense: “frotz”, “blorb”, “rezrov” would be fine). Just some way we can see the exact structure of your code.

I can do that, but exactly how much do you want to see? It’s pretty extensive.

All the relevant rules. I.e. all the “instead of going…from the Kitchen” rules.

I’ll do that soon, Draconis.
In the meantime, I discovered that I can reach the conclusion of the game using “abstract me.”
The conclusion is reached by going north from a room called Counter to a room called Parking Lot.
If I play the game through, once I’m back in Counter and try to go north, I either “fail” (instead rule) or “end without result” (check rule).
But if at, say, the beginning of the game I “abstract me to Counter” and then go north, I end up in Parking Lot in one of two possible conclusions of the game.

Here’s the code:

[code]Check going north from Counter:
end the story saying “[if player does not wear hat]The guys see you coming out, but they don’t look happy. For some reason, you have disappointed them.”

Check going north from Counter:
end the story saying “[if player wears hat]The guys see you coming out, and they look elated. They cheer you and you drive home.”[/code]