Don't take off your shoes

I’m trying to prevent an action if the player isn’t wearing shoes, but Inform doesn’t like “if player is not wearing shoes.”

Any suggestions?

Read p. 13.4 of “Writing with Inform.” That would be my suggestion.

I’ll do that now. Thanks!

I guess I’m just thick, but I read 13.4 and it doesn’t address not wearing something. I am trying to write a condition, which relies on not wearing shoes, which the player has worn and presumably has taken off.

instead of [doing whatever]: if player is wearing the shoes: say "You can't do that while wearing those damn shoes!"; otherwise: continue the action.

Thanks, NTW, but I’m trying to get just the opposite effect. The player can’t do something if he’s not wearing shoes. The player must be wearing shoes to accomplish the action.

instead of [doing something]: if player is NOT wearing the shoes: say "You can't do that unless you put on your damn shoes!"; otherwise: continue the action.

This is from that page:

So as a random suggestion, you might try something like this:

if the shoes are not worn by the player:

Geez, neither of those last two suggestions worked. I guess it’s just a matter of the correct grammar, but I’m not finding it.

Paste your most current error so’s we can take a look-see.

Instead of taking anything when player is in Store: if the player is not wearing the shoes: say "No shirt, no shoes, no service."; otherwise: continue the action.

And the error message is:

Problem. In the sentence ‘if the player is not wearing the shoes’ , I was expecting to read a condition, but instead found some text that I couldn’t understand - ‘player is not wearing the shoes’.

I checked the phrasing I’d use, and it worked, both in terms of compiling as well as properly preventing/responding to the action:

Instead of going west when the player does not wear the robes: say "Get dressed!"

Try “player does not wear the shoes” instead of “player is not wearing the shoes”.

But I’m not certain. Shark Tank is on, so I’m a bit distracted.

No, sorry, MTW, that did not compile.
lux, if I had just one condition, I think I could compile, but I have two: being in the store and not wearing shoes.

Two conditions compiled fine for me with the exact same kind of phrasing and also worked in-game.

Instead of going west when the player is in Bedroom and the player does not wear the robes: say "Get dressed!"

Exactly what is the code that’s failing to compile for you?

Problem. In the sentence ‘if the player does not wear the shoes’ , I was expecting to read a condition, but instead found some text that I couldn’t understand - ‘player does not wear the shoes’.

No, I mean, what’s the code you are actually sending through the compiler? Do you actually have a thing called shoes?

Here’s a general principle upon which to meditate: Computers LOOK like they’re brilliantly smart, but in fact an avocado is smarter than a computer. Hell, a turd is smarter than a computer. (And yes, I do mean that quite literally. I’ve been reading a feature in Scientific American about intestinal microflora.)

In order to convince a computer to do anything, you have to be incredibly picky about how you give it its instructions. The instructions you give it are called computer programming. Your IF story is a form of computer programming. If the computer doesn’t do what you have in mind, you’re not being picky enough. That’s a complete and accurate description: You need to become more picky.

That last still doesn’t compile, so I tried simplifying with:

[code]Instead of taking anything when the player does not wear the shoes, say “No shirt, no shoes, no service.”

I still got a problem message;

Problem. You wrote ‘Instead of taking anything when the player does not wear the shoes’ , which seems to introduce a rule taking effect only ‘when the player does not wear the shoes’. But this condition did not make sense, so I am unable to accept this rule.

And yes, I do have a thing called shoes.

And Jim: I don’t get how I am supposed to be more picky in this situation.

And a turd is smarter than me, I’m starting to feel. Even an avocado.

Being picky means learning to think in the simplest possible logical steps. It’s a skill, like playing the violin.

When you get this error message, the first thing to ask yourself is, “Do I have an object called the shoes?” The pickiness of thinking can take many forms. Let’s suppose, for example, that you’ve given the player two wearable things: a left shoe and a right shoe. You have declared that a shoe is a kind of thing, and that the player wears a left shoe and a right shoe. So far, so good. But the fly in the ointment is, Inform literally does not know that the left shoe and the right shoe are called, collectively, “shoes.”

That’s an example of how picky you need to be. Once you’ve dealt with that possible source of errors, you move on to the next one – punctuation and spelling. And so on.