A bug? Or am I confused?

I’ve either found a bug, or am completely confused. This is my first attempt at authoring IF, so I wouldn’t be surprised if it was the later.

Here’s the relevant part of my code:

[code]“Underage” by “Marcus Pascall”

The Air Conditioned Store is a room.

In the Air Conditioned Store is a man called clerk. Alcohol is carried by the clerk.

Understand “beer/vodka/tequila/rum/wine cooler/wine/booze” as alcohol.

Instead of asking the clerk about “alcohol”, say “The clerk looks you up and down and says ‘You are not old enough for me to sell you alcohol.’”

Before buying [something]:
try asking the clerk about “[noun]”;
stop the action.[/code]

For some reason, if the player types “buy wine cooler”, it works (the relevant text is displayed). But if he types “buy beer” (or vodka, tequila, etc), it says “You can’t see any such thing here.”

My question is, why does wine cooler work, and yet not the rest?

Thanks,
-M

edit: I’m using Inform (1.2 6.31/6G60) on a 64-bit Ubuntu system.

This will work, as far as it goes:

[code]“Underage” by “Marcus Pascall”

The Air Conditioned Store is a room.

In the Air Conditioned Store is a man called the clerk. Alcohol is carried by the clerk.

Understand “beer/vodka/tequila/rum/wine/booze” or “wine cooler” as alcohol.

Instead of asking the clerk about “[alcohol]”, say “The clerk looks you up and down and says ‘You are not old enough for me to sell you alcohol.’”

Before buying [something]:
try asking the clerk about “[noun]”;
stop the action.[/code]

The two important changes I made are: separating the two-word phrase into its own quotes (for “wine cooler”) because two-word thingies don’t play well with the slashy-list thing, and putting brackets around the token “[alcohol]” to allow the asking-about to work.

I also added “the” to “clerk,” so the room description makes more sense (It now says “You can see the clerk here” instead of “You can see clerk here”).

Looks like “wine cooler” has a space. You need to separate that from the others.

Try “vodka booze” and I bet it works. Your understand line is asking for a two word combination.

Understand “beer/wine/vodka” and “wine cooler” as alcohol.

Understand “bay/sea/rum breeze” will match “sea breeze” but not “rum”.

The slash shortcut only works with single words. You’re telling the game to understand a two-word phrase, where both words are mandatory; the first word must be beer/vodka/tequila/rum/wine, the second must be cooler/wine/booze. So “wine cooler” works, as does “rum cooler”, “vodka booze”, …

Also, as a note, where you wrote [something] in square brackets – that’s a comment, not a token.

Wow, thanks everyone for the quick replies. I understand now. :slight_smile:

Now a second issue that I’ve been scratching my head over for hours. Here’s the same code, except I’ve added lines for buying cigarettes.

[code]The Air Conditioned Store is a room.

In the Air Conditioned Store is a man called the clerk. Alcohol and cigarettes are carried by the clerk.

Understand “beer/vodka/tequila/rum/wine/booze” as alcohol.

Instead of asking the clerk about “[alcohol]”, say “The clerk looks you up and down and says ‘You are not old enough for me to sell you alcohol.’”

Understand “cigs/cig/smokes” as cigarettes.

Instead of asking the clerk about “[cigarettes]”, say “The clerk pulls a pack from above the counter, and says ‘That’ll be $3.50.’”

Before buying [something]:
try asking the clerk about “[noun]”;
stop the action.
[/code]

When the player “buy alcohol”, it works no problem. When “buy cigarettes”, it responds with “There is no reply.”

The strange thing is, if I swap those two “instead” lines, then cigarettes works and alcohol doens’t. So the first “instead” always works and the second always fails. What am I don’t wrong?

Thanks,
-M

[rant]Check the world tab of the index; have you by any chance created a single object called “alcohol and cigarettes”? Then it might work to say “The clerk carries alcohol. The clerk carries cigarettes.”[/rant]

Never mind, that’s not it.

OK, with some fiddling I think you’re hitting a weird bug/behavior of topics; when you check the thing you’ve asked for against [cigarettes] (or [alcohol], depending on which is first), Inform stores that topic in “the noun.” So by the time you run the second check, it thinks you’re asking alcohol about alcohol, and the rule doesn’t run. There’s some discussion here, and there’s a uservoice suggestion that goes into it here, though I firmly believe this is a bug and not a feature suggestion. (And here’s a bug report.)

The workaround you pointed me to works!

Thanks for that. I don’t know that I would’ve found any of that by searching the boards.

Its good to know its a bug and not me misunderstanding the language. :slight_smile: