Code was working, now it's not

Player is in Living Room and the command is “south” which should have landed her on Porch.

Before going south while player is in Living Room: if player is not wearing clothes: say "You won't get far without wearing clothes."; stop the action; 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.

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?

take purse
Taken.

Watcha’ wanna do next?

s
Watcha’ wanna do next?

l
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 here.

Watcha’ wanna do next?

rules
Rules tracing now switched on. Type “rules off” to switch it off again, or “rules all” to include even rules which do not apply.

s
[Rule “declare everything initially unmentioned rule” applies.]
[Rule “standard set going variables rule” applies.]
[Rule “announce items from multiple object lists rule” applies.]
[Rule “set pronouns from items from multiple object lists rule” applies.]
[Rule “before stage rule” applies.]
[Rule “Before going south while player is in Living Room” applies.]
[Rule “A first turn sequence rule” applies.]
[Rule “every turn stage rule” applies.]
[Rule “Every turn when player carries purse” applies.]
[Rule “Every turn when player carries purse” applies.]
[Rule “Every turn when player carries purse” applies.]
[Rule “Every turn” applies.]
Watcha’ wanna do next?

[Rule “A last turn sequence rule” applies.]
[Rule “notify score changes rule” applies.]

It’s a simple indentation problem. The first “stop the action” needs one more tab indent.

See how “stop the action” is not indented? It’s not part of the “if” above it; so it stops the action unconditionally.

Thank you Jim and zarf, and nuts on me for not noticing!

Well, goobers! The mystery continues!
Program doesn’t believe player is wearing the halter.

Before going south while player is in Living Room: if player is not wearing clothes: say "You won't get far without wearing clothes."; stop the action; 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; if player is not wearing tampon: say "Oh BLOODY hell. You're not going out without ... "; stop the action.

Results:

wear halter
You put on the skimpy halter.

Watcha’ wanna do next?

wear heels
You put on the pair of six-inch heels.

Watcha’ wanna do next?

s

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?

take purse
Taken.

Watcha’ wanna do next?

s
No halter? You wanna get arrested?

With RULES on:

rules
Rules tracing now switched on. Type “rules off” to switch it off again, or “rules all” to include even rules which do not apply.

s
[Rule “declare everything initially unmentioned rule” applies.]
[Rule “standard set going variables rule” applies.]
[Rule “announce items from multiple object lists rule” applies.]
[Rule “set pronouns from items from multiple object lists rule” applies.]
[Rule “before stage rule” applies.]
[Rule “Before going south while player is in Living Room” applies.]
No halter? You wanna get arrested?

[Rule “A first turn sequence rule” applies.]
[Rule “every turn stage rule” applies.]
[Rule “Every turn when player carries purse” applies.]
[Rule “Every turn when player carries purse” applies.]
[Rule “Every turn when player carries purse” applies.]
[Rule “Every turn” applies.]
Watcha’ wanna do next, Pussy Leak?

[Rule “A last turn sequence rule” applies.]
[Rule “notify score changes rule” applies.]

I suggest typing >i to see what the PC is wearing. Possibly you’ve written a rule to handle ‘wear halter’ that doesn’t actually cause the garment to end up being worn.

I just did, Jim. PC is wearing the halter.

i

You are carrying:
a purse (closed)
a thong (being worn)
a pair of six-inch heels (being worn)
a skimpy halter (being worn)
a wickedly-short miniskirt (being worn)
a tampon (being worn)

The second possibility is that you have inadvertently created two different halter objects, and that your Before rule is testing the wrong one. You can check this in the World tab of the Index.

WARNING: This concerns a XXX game, and some may find it offensive.

Here are all the mentions of “halter” in the code:

[code]Check wearing halter when player is in Bedroom:
say “One simple rule: NEVER wear clothes in a bedroom. Your bedroom or anyone else[’]s.”;
stop the action.

Clothes is a kind of wearable thing. The thong, the wickedly-short minskirt, the halter and the heels are clothes.

A wickedly-short miniskirt, a skimpy halter and a pair of six-inch heels are wearable things in Closet.

The description of the skimpy halter is “Your favorite halter, because it’s so easy to pull aside to expose your tits.”

Understand “top” as halter.

Before going south while player is in Living Room:
if player is not wearing clothes:
say “You won’t get far without wearing clothes.”;
stop the action;
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;
if player is not wearing tampon:
say "Oh BLOODY hell. You’re not going out without … ";
stop the action.

Instead of starting engine:
say “You close the car door, start the car and back out of the driveway. Several times during the trip to Fantasy Land you pull aside the halter to flash your tits at the other motorists. Finally you arrive at the infamous porno shop and get out of the car.”;
now Mustang is in Parking Lot;
now player is in Parking Lot.

Instead of kneeling when player is in Booth:
if player wears halter:
say “The eye continues to stare at you. It seems the guy on the other side of the hole expects you to do something.”;
otherwise:
continue the action.

Check going west when player is in Booth:
if player does not wear halter:
say “1You must be fully dressed to leave the booth.”;
otherwise:
continue the action.[/code]

If you have pasted this stuff in the order it’s presented in the source code, it looks to me as if you have indeed created two objects – a halter and a skimpy halter. Did you check the World tab in the Index?

My testing seems to indicate that I’m guessing right. It makes a huge difference what order you write things in, unless you’re careful always to use the same terminology for referring to the thing. Alternating “halter” and “skimpy halter” will give the desired result ONLY if you have placed the skimpy halter first in the source code.

I’m going to repeat what Jim just said… Check your code; you’ve got two halters in there.

I’ve copy/pasted your code, compiled, and take a look at what’s gotten created…

[code] thong - Clothes

… …
thing > Clothes > thong
printed name: “thong”

mentioned in rules:

… …

wickedly-short minskirt - Clothes

… …
thing > Clothes > wickedly-short minskirt
printed name: “wickedly-short minskirt”

… …

halter - Clothes

… …
thing > Clothes > halter
printed name: “halter”

mentioned in rules: ;

… …

heels - Clothes

… …
thing > Clothes > heels
printed name: “heels”

… …

tampon - Clothes

… …
thing > Clothes > tampon
printed name: “tampon”

mentioned in rules:

… …

wickedly-short miniskirt

… …
thing > wickedly-short miniskirt
wearable
printed name: “wickedly-short miniskirt”

mentioned in rules:

… …

skimpy halter

… …
thing > skimpy halter
wearable
printed name: “skimpy halter”
description: “Your favorite halter, because it’s so easy to pull aside to expose your tits.”

… …

pair of six-inch heels [/code]

You’ve got two halters there. You’ve also got a “miniskirt” and a “minskirt”. You’ve been told before, you can’t take shortcuts when creating items. When you say “The halter is Clothes” and later “The skimpy halter is a wearable thing in Closet”, you’ve created two halters.

Here, try this instead. Remove the lines “Clothes is a kind of wearable thing. The thong, the wickedly-short minskirt, the halter and the heels are clothes. A wickedly-short miniskirt, a skimpy halter and a pair of six-inch heels are wearable things in Closet.” and in their place put:

Clothes is a kind of wearable thing. The thong, the wickedly-short miniskirt, the skimpy halter, the tampon and the pair of six-inch heels are clothes. The thong, the wickedly-short miniskirt, the skimpy halter and the pair of six-inch heels are in Closet. 

EDIT - Jim beat me to it. :slight_smile:

This is the seductive danger of Inform 7. It’s not always clear to the author that he or she is in fact creating a new item.

I replaced two references to “halter” with “skimpy halter” and now the code works. Thanks.

If you’re not going to use the snippet of code I suggested as a replacement, then at least fix your “minskirt” as well.