Making Inform understand going inside as entering a door

Having a small problem here. In the opening screen, I’m having loads of scenery but I’m also having the player not be able to interact with anything other than a very particular door. The reason for this is setting up an oppressing atmosphere and the feeling that something very strange is at play here. I had an earlier version of the code that was way longer and messier so I decided to rewrite it. The draft includes flavor text that appears when you open and enter the door. I can’t however seem to be able to make the game treat going inside as synonymous with entering the door, which I kinda need it to, as the “in” command, I feel, is the way likelier thing for the player to try compared to “enter door”. Any work arounds you can think of?

Instead of doing something other than examining, opening, entering or closing the cellar door when not looking:
	if the player is in the walled garden or not going inside from the walled garden:
		say "Try as you might, you can't take your eyes off the door. It's beckoning to you."
		
Understand "going inside [from the walled garden]" as entering the cellar door.

The error message I’m getting is the following. There should be nothing wrong with my version. I downloaded it very recently and made sure it was the latest release.

An internal error has occurred: unowned. The current sentence is ‘Understand “going inside [from the walled garden]” as entering the cellar door’ ; the error was detected at line 886 of “inform7/if-module/Chapter 5/Understand Sentences.w”. This should never happen, and I am now halting in abject failure.

What has happened here is that one of the checks Inform carries out internally, to see if it is working properly, has failed. There must be a bug in this copy of Inform. It may be worth checking whether you have the current, up-to-date version. If so, please report this problem via www.inform7.com/bugs.

As for fixing your source text to avoid this bug, the last thing you changed is probably the cause, if there is a simple cause. Your source text might in fact be wrong, and the problem might be occurring because Inform has failed to find a good way to say so. But even if your source text looks correct, there are probably rephrasings which would achieve the same effect.

You generally can’t use an “understand” statement to generate a specific action, so that’s some of what you’re running into; the “[from the walled garden]” text token is also confusing, since that’s not something the player will (or can) type – I think you’re using it as a condition?

The easiest solution here is probably just an instead rule; probably something like:

Instead of going inside when the player is in the walled garden:
       Try entering the cellar door.
1 Like

I’ve edited your code to remove the understand phrase (which isn’t well-formed):

The walled garden is a room. The cellar door is a door. It is inside from the walled garden and outside of the space capsule.
Instead of doing something other than examining, opening, entering, closing the cellar door when not looking:
	if the player is in the walled garden or not going inside from the walled garden:
		say "Try as you might, you can't take your eyes off the door. It's beckoning to you."

Two points:

  1. Entering a door gets converted into going, not the other way around, so even enter door will get you “Try as you might…”.
  2. Your instead rule has blocked going entirely.

The understand rule doesn’t work because your “as” phrase can’t be that specific.

I’m thinking about the most efficient way to achieve what you want…

2 Likes

good point. This isn’t a valid grammar token.

Why you’re getting the errors you are is confusing. What inform version are you using?

1 Like

This was the ticket! Thanks!

1 Like

10.1.2

Sorry, it seems I spoke too soon!

I no longer get an error report but it’s still not working as intended. Here’s the current source (a few other syntactic formulations have been tried):

Instead of doing something other than examining, opening, entering or closing the cellar door when not looking or going:
	if the player is in the walled garden:
		say "Try as you might, you can't take your eyes off the door. It's beckoning to you."
Instead of going inside when the player is in the walled garden:
	Try entering the cellar door.
Before entering the cellar door:
	try opening the cellar door.

and this is what it looks like in game:

Walled Garden
You find yourself in a strange place, and you have no recollection of how you got there. You are surrounded on all sides by smooth stone walls that have an impenetrable, unclimbable look to them. You think this place used to be someone’s garden once, but the trees, bushes and sprigs of wild thyme have long since conquered the splintered yellow brick path that leads to an old and half-rotten wooden door to the north. The mere sight of it makes you feel cold despite the scorching sun.

go in
As the cellar door creaks open, you hesitate for a moment, unsure of what lay beyond its weathered frame. The dusty air carries a hint of musk and secrecy, adding to the allure of the unknown.

Your curiosity wins out, and with a deep breath, you take a step forward, crossing the threshold into the enigmatic world that awaits.

Try as you might, you can’t take your eyes off the door. It’s beckoning to you.

l
Walled Garden
You find yourself in a familiar place. You are surrounded on all sides by smooth stone walls that have an impenetrable, unclimbable look to them. You think this place used to be someone’s garden once, but the trees, bushes and sprigs of wild thyme have long since conquered the splintered yellow brick path that leads to an old and half-rotten wooden door to the north. The mere sight of it makes you feel cold despite the scorching sun.

So looking works fine but going in still gets blocked, although it does carry out the initial steps.

Edit: You can probably intuit from the room’s description that I also need to make “go north” work, but I figured I’ll have that solved once “in” is solved so I didn’t mention it separately earlier.

You might try this:

Before doing something when the location is the walled garden:
	if the current action is looking:
		continue the action;
	if the current action is going inside:
		continue the action;
	if the noun is not the cellar door:
		say "Try as you might, you can't take your eyes off the door. It's beckoning to you.";
		stop the action;

That will block all actions except doing something to the door (including entering), or going in.

2 Likes

YES! Solved!