Why doesn't this work?

OK, guys, I am back with a problem that will likely have an easy answer that I am overlooking.

I am trying to put together a scene where someone is waking up. I would like to prevent the PC from sitting on the couch before fixing a cup of coffee (perfectly plausible, right?).

The problem is that I can’t get that done. Here is the only code I was able to write to this effect that compiled:

[code]The couch is an enterable supporter. The couch has a carrying capacity 3. The couch is in the Living Room.

Before entering the couch:
if the player does not carry a cup of coffee, say “I need java before I sit down.” instead.
[/code]

All indentation is correct and when I click play it does compile, but when I try to sit on the couch, nothing stops me. What am I missing?

Tommie

Hi Tommie,

It would be better if you posted a complete example of your code. The code above doesn’t compile since you haven’t defined a room called “the Living Room” or anything called “a cup of coffee.” When I add the minimum required to get it to compile: The Living Room is a room. A cup of coffee is in the Living Room. … it works as expected. Here’s the output:

If you’re getting a different result, it must be something in your other, unposted code.

Mike,

Thanks for the heads up. I left those parts out on purpose because I knew that if I made a mistake in the room and item definitions, that was the quickest way to get it. Thought I put that in my OP, but it seems I omitted that. Sorry.

So I spent some time with three windows open to try figuring out the problem. I found it.

It ends up that I am using the extension “‘Liquid Handling’ by Al Golden”. That one requires a second Golden extension, “Supplemental Actions”. Supplemental actions separates “sit” and “enter” as synonyms. In fact, according to the accompanying documentation:

Which begs the question, do I have to now create two clauses under the “Before” rule, or is there a quick and easier way to re-synonym-ify (like that coinage?) those words? [rant]Honestly, I can see the utility of having those words no longer be synonyms, but I think that the utility is rare enough that it shouldn’t be part of an extension that will see so much work.[/rant]OK, rant over.

Tommie

I would use Understand "sit" as something new. Understand "sit" as entering. but I am not completely sure if this would work (haven’t tested it yet), and you might not need to include the “something new” phrase.

Actually, the “‘sit’ as entering” code was something I tried that wouldn’t compile originally. The problem was simply that the original library (Standard Rules by Graham Nelson) already realizes “sit”, “stand”, and “lie” as being the same as “enter” with regards to enterable supporters. The extension Supplemental Actions by Al Golden undid this, and it SEEMS (didn’t try all that hard once I found a work around) that any code written to try to undo this causes a fight in I7 that the compiler just can’t resolve.

The code that ended up working was:

[code]The couch is an enterable supporter. The couch has a carrying capacity 3. The couch is in the Living Room.

Before entering or sitting on the couch:
if the player does not carry a cup of coffee, say “I need java before I sit down.” instead.

Before sitting in or lieing on or lieing in or standing on or standing in the couch:
try sitting on the couch instead.

A cup of coffee is a thing. A cup of coffee is in the Kitchen.
[/code]

Tommie

You could also define all those things as a kind of action.

[code]Sitting on something is reposing. Sitting on something is reposing.
Lying on something is reposing. Lying in something is reposing.
Standing on something is reposing. Standing in something is reposing.
Entering something is reposing.

Before reposing when the noun is the couch:
if the player does not carry a cup of coffee, say “I need java before I sit down.” instead.[/code]