"Say" not firing

Instead of going south when player is in Living Room: if player is not wearing anything: say "Let's not tempt fate. You need to be dressed to go outside."; else if player is not wearing thong: say "No thong? You wanna get arrested?"; else if player is not wearing wickedly-short miniskirt: say "No skirt? Let's not tempt fate!"; else if player is not wearing halter: say "No halter? You wanna get arrested?"; else if player is not wearing six-inch heels: say "No shoes? There's an ordinance against that in this town."; otherwise: continue the action.

Result:

Living Room
A place for entertaining. There’s a poster on one wall.
You can go north to the Dressing Room through the purple-colored door or south to the Porch through the pink door.

You can see a purple-colored door, a pink-colored door, a poster and a table (on which is a purse (closed)) here.

Watcha’ wanna do next?

s

Porch
It’s a bright, sunny day! You can go back into the house to the north, or take the path to the east to get to the driveway.

You can see a pink-colored door here.

The game is supposed to stop the player from going south from the Living Room to the Porch if she’s not properly attired, but as you can see it doesn’t. Did I write something wrong, or is God just punishing me?

That code works for me. (Assuming the clothing items are defined.)

It’s not working for me, though. And yes, the clothing items have been defined.

Given that Zarf was unable to reproduce the behavior you describe with just your snippet, you’ll need to post a complete game that exhibits it, or no one will be able to help you. And it’s best if that complete game is as short as possible, with no extraneous features.

It is very likely that you will discover the problem in the course of chopping out material unrelated to the problem. If that happens, please tell us about it! It may be useful for someone else encountering a similar problem.

For this specific problem, my psychic powers suggest that using RULES ALL will help. Either you have some other Instead rule making a decision to permit this action before this one gets a chance, or the player is not really “in Living Room” when you expect her to be. Try “when the location is Living Room” instead.

OL, thanks. Program is complete, and none of you guys want to go through it, believe me.

Hmm. Try this:

Before going south while player is in Living Room:
	if player is not wearing thong:
		say "No thong? You wanna get arrested?";
                stop the action;
	if player is not wearing wickedly-short miniskirt:
		say "No skirt? Let's not tempt fate!";
                stop the action;
	if player is not wearing halter:
		say "No halter? You wanna get arrested?";
                stop the action;
	if player is not wearing six-inch heels:
		say "No shoes? There's an ordinance against that in this town.";
                stop the action;

The “stop the action” code made this work for me. Also, not sure if this is a hard rule, but I used “Before going” and “while” instead of “when”. I also removed the “else” before each if statement. Not sure, but that might have stopped the loop somehow. Hopefully this fixes the problem!

(edit)
This isn’t working for me, though:

if player is not wearing anything:
     say "Let's not tempt fate. You need to be dressed to go outside.";
     stop the action;

Specific items trigger the script, but I can’t seem to get inform to understand “not wearing anything.” The stop the action should work for each specific item you mention, though. This would explain why the “else if” statements were being skipped, if “not wearing anything” was taken by Inform to mean not wearing something called anything. Computer logic, right?

Your sample makes a lot of changes but I don’t think any of them will affect holmes’s underlying problem. Your code works the same for me as his, even when I add the “not wearing anything” case back in.

“if player is not wearing anything” is legal and means what you think it does. “when” vs “while” are both valid here. A before rule with “stop the action” clauses is the same as an instead rule with no “continue the action”.

Interesting – the most likely difference is the “else if” vs. “if” cases. I’ve got similar code from one of my own projects that I pulled that works for me, and the individual exceptions work fine, but I can’t get the not wearing anything rule to work, either. If that rule isn’t working, wouldn’t the “else if” rules be escaped, coming after it?

Also, I’m using 6G60. I never upgraded to the new version, which may or may not make a difference.

(edit)
Nope – else if doesn’t make a difference, the individual exception still works after it. I just can’t get the “not wearing anything” clause to work. shrug

(edit #2)
Oooo-kay. I should probably not test code in my own WIP. I have a limb system for the player that’s wearable. That’s why the code isn’t working. The code is fine. :stuck_out_tongue:

Anyway – I’m stumped. One thing you can do (which was suggested before) is to comment out large parts of your game, and just test small pieces, then bring more and more things back in until you find the breaking point. Sometimes, that’s the only way to fix a bug.

holmes, you should definitely do a “rules” test (type “rules” at the command prompt before going south)–it’s possible that you’ve got another rule which is messing this one up somehow.

Disregard the following – I moved the “stop the action” lines to align with the “if” clauses, and now the thing works. Thanks all.

Quote
Hmm. Try this:

Before going south while player is in Living Room:
	if player is not wearing thong:
		say "No thong? You wanna get arrested?";
                stop the action;
	if player is not wearing wickedly-short miniskirt:
		say "No skirt? Let's not tempt fate!";
                stop the action;
	if player is not wearing halter:
		say "No halter? You wanna get arrested?";
                stop the action;
	if player is not wearing six-inch heels:
		say "No shoes? There's an ordinance against that in this town.";
                stop the action;

I tried that and got this:

Problem. The phrase or rule definition ‘Before going south while player is in Living Room’ is written using the ‘colon and indentation’ syntax for its 'if’s, 'repeat’s and 'while’s, where blocks of phrases grouped together are indented one tab step inward from the ‘if …:’ or similar phrase to which they belong. But the phrase ‘if player is not wearing wickedly-short miniskirt’ , which ought to begin a block, is immediately followed by ‘say “No skirt? Let’s not tempt fate!”’ at the same or a lower indentation, so the block seems to be empty - this must mean there has been a mistake in indenting the phrases.


Problem. The phrase or rule definition ‘Before going south while player is in Living Room’ is written using the ‘colon and indentation’ syntax for its 'if’s, 'repeat’s and 'while’s, where blocks of phrases grouped together are indented one tab step inward from the ‘if …:’ or similar phrase to which they belong. But the phrase ‘if player is not wearing halter’ , which ought to begin a block, is immediately followed by ‘say “No halter? You wanna get arrested?”’ at the same or a lower indentation, so the block seems to be empty - this must mean there has been a mistake in indenting the phrases.


Problem. The phrase or rule definition ‘Before going south while player is in Living Room’ is written using the ‘colon and indentation’ syntax for its 'if’s, 'repeat’s and 'while’s, where blocks of phrases grouped together are indented one tab step inward from the ‘if …:’ or similar phrase to which they belong. But the phrase ‘if player is not wearing six-inch heels’ , which ought to begin a block, is immediately followed by ‘say “No shoes? There’s an ordinance against that in this town.”’ at the same or a lower indentation, so the block seems to be empty - this must mean there has been a mistake in indenting the phrases.


Problem. The phrase or rule definition ‘Before going south while player is in Living Room’ is written using the ‘colon and indentation’ syntax for its 'if’s, 'repeat’s and 'while’s, where blocks of phrases grouped together are indented one tab step inward from the ‘if …:’ or similar phrase to which they belong. But the tabs here seem to be misaligned, and I can’t determine the structure. The first phrase going awry in the definition seems to be ‘stop the action’ , in case that helps.

This sometimes happens even when the code looks about right, to the eye, if rows of spaces have been used to indent phrases instead of tabs

Really – that code works in place of your previous code? That is kind of bizarre, since I’m not sure what context that code actually changed! Basically, my sample was nearly identical to your original, with different phrasings. Maybe we should file this under the “Inform works in mysterious ways” rule, in this case.

Changing it from a “before” rule to an “instead” rule makes it run much earlier. My guess is still that there was another rule that was firing before the “instead” and messing it up. Is it possible that you use an “Instead” rule to move the player south from the living room?