Seems to me this hould work.
The code is supposed to keep the player from leaving the lavatory before he cleans up. Instead it just fails.
Instead of going northwest while player is in Lavatory:
if player has not held comb:
say "Your hair is mussed up";
stop the action;
otherwise:
if player has not held razor:
say "Really, man, you got stubble the size of asperagus.";
stop the action;
otherwise:
if player has not held toothbrush:
say "Are you kidding? Stanley Kowalski has better breath than you do right now.";
stop the action;
otherwise:
if player wears foam:
say "Your haven[']t dealt with the Burma-Shave yet.";
stop the action;
otherwise:
continue the action.
Transcript:
Make like a fiddle: ske-diddle!
drop can
Dropped.
What’s the story, morning glory?
take razor
Taken.
What’re you waitin’ for? Do something!
shave face
Lookin’ sharp,
Make like a fiddle: ske-diddle!
i
You are carrying:
a razor
What now, brown cow?
drop all
(the razor)
Dropped.
What’re you waitin’ for? Do something!
nw
One o’clock, two o’clock, three o’clock – Do somethin’, man!
acttions
That’s not a verb I recognise.
actions
Actions listing on.
nw
[going northwest]
[going northwest - failed the Check going northwest]
Looks like the problem is in a Check rule somewhere else in the code as opposed to the Instead rule you showed.
OK, here are the check rules:
Check going northwest:
if player is in Lavatory:
if player holds comb:
say “Where you think you’re going with that stuff in your hands?”;
stop the action.
Check going northwest:
if player is in Lavatory:
if player holds razor:
say “Where you think you’re going with that stuff in your hands?”;
stop the action.
Check going northwest:
if player is in Lavatory:
if player holds toothbrush:
say “Where you think you’re going with that stuff in your hands?”;
stop the action.
Check going northwest:
if player is in Lavatory:
if player holds tube of toothpaste:
say “Where you think you’re going with that stuff in your hands?”;
stop the action.
What is the precise indentation of those check rules?
The indents aren’t coming thru to this forum. I checked 'em, and everything seemed to line up properly. If they hadn’t, Inform would have refused to compile.
If the “stop the action” in the check rules isn’t indented all the way (farther than the last if statement) the code will compile, but the “stop the action” will run when you don’t want it to.
One way to figure out what’s going on is to give your rules names like this:
Check going northwest (this is the can't leave the Lavatory with the comb rule):
Then your “actions” output will tell you which rule it failed.
You could combine those check rules efficiently, by the way:
Check going northwest in the lavatory:
if the player holds the comb or the player holds the razor or the player holds the toothbrush or the player holds the tube of toothpaste:
say "Where do you think you're going with that stuff in your hands?" instead.
(“Instead” there is like “stop the action.”) You could even make things a bit quicker by giving things a property like “toiletry”; then you could write:
Check going northwest in the bathroom when the player holds a toiletry thing:
Cool. Toiletry it is! Thanks!