Going in and going out seem to be two different things.

… and that shouldn’t surprise anyone.

Fact is, if i code something like

Instead of exiting when the player is in his_house, say "You don't want to go out."

it works, while if I code

Instead of going in when the player is in his_house, say "You don't want to go in, also."

the game replies with the conventional “You can’t go that way.”

Given the standard responses being different I sense there are two different rules applying here, but I can’t get past around it.

Any suggestion?

Shouldn’t it be this?

Instead of going inside when the player is in his_house, say "You don't want to go in, also."

The going action applies to directions, and “inside” is a direction while “in” isn’t. When I dropped your line into a project I had, your line didn’t compile, but it worked when I changed it to “inside.” (You might also need a line for “going outside,” which is a different action from exiting.)

Anyway, you might want to look at section 7.13 of the documentation, which will tell you how to tighten these up a little. This also works:

Instead of going inside in My Room, say "You don't want to go in, also."

Bah. I always get stuck on things like that.
You can’t understand how much of an idiot now I feel :slight_smile:

Thanks.

As a sidenote: going in when the player is in etc. compiles in my I7. It doesn’t when it’s a global thing (es: Instead of going in, try going out). That’s funny.

I wrote some code to erase the difference between the (intransitive) exiting action and going outside, as well as the difference between the (transitive) entering action and going inside. I made transitive and intransitive alternatives for entering and exiting as well. If you want to see the code, I’ll post it.

Of course I’d like!

thanx.

[code]Chapter - Exiting and Entering

Section - Transitive Exiting

Getting out of is an action applying to one thing. Understand “exit [something]” as getting out of.

Understand “out/off/down/up” as “[out]”. Understand “of/from” as “[from]”. Understand “[out]” and “[out] [from]” and “[from]” as “[out of]”.

Understand “exit [out of] [something]” as getting out of. Understand “get [out of] [something]” as getting out of. Understand “go [out of] [something]” as getting out of.

Check getting out of when the noun does not enclose the player:
say “You’re not [if the noun is a supporter]on[otherwise]in[end if] [the noun] right now.”

Check getting out of:
Let the outer enclosure be the noun;
while the outer enclosure encloses the player:
let the inner enclosure be the holder of the player;
If the inner enclosure is not the outer enclosure:
say “(First exiting [the inner enclosure])[command clarification break]”;
silently try exiting;
otherwise:
try exiting;
if the inner enclosure is the holder of the player:
stop the action;

Section - Going Outside

Check going nowhere when the noun is outside:
Try exiting instead.

Section - The Way Out

A room has an object called the way out.

Definition: A room is exitable if the way out of it is a direction.

Definition: A direction (called way) is viable:
Decide on whether or not the room to the way is a room.

Definition: A direction (called way) is outward:
If way is the way out of the location, yes;
If way is inward, no;
decide on whether or not way is viable.

Check exiting when the holder of the player is an exitable room:
Try going the way out of the location instead.

Check exiting when the holder of the player is a not exitable room:
If the number of outward directions is 1:
let the way be a random outward direction;
say “(leaving to [the way])[command clarification break]”;
try going the way instead.

Section - The Way In

Definition: A direction (called way) is inward:
Let destination be the room to the way;
if destination is not a room, no;
decide on whether or not the way out of destination is the way from destination.

To decide what object is the way in:
If the number of inward directions is 1, decide on a random inward direction;
decide on nothing.

Check going nowhere when the noun is inside and the way in is a direction:
Try going the way in instead.

Section - Intransitive Entering

for supplying a missing noun when entering (this is the enter the location rule):
Now the noun is the location.

The enter the location rule is listed after the find what to enter rule in the for supplying a missing noun rulebook.

Check entering the location:
Try going inside instead.

Check going nowhere when the noun is inside:
say “There’s no obvious way to go inside from here.” instead.
[/code]

You could probably simplify that by removing the “way out/way in” stuff. As it stands, it requires you to state explicitly what the way out of every room is.

"(leaving to [the way])[command clarification break]"

Won’t this produce goofy results when the way is up or down? Maybe “(leaving by going [way])” would work better.

Yes, it would. My WIP doesn’t have any up or down, so I never thought of it.

I’ve thought about writing an extension for describing directions and relative locations. This would have to be part of it. Something like:

To say to the/-- (way - a direction): If way is: -- up: say "upwards"; -- down: say "downwards"; -- inside: say "inwards"; -- outside: say "outwards"; -- otherwise: say "to [the way]";

Yeah, that seems like it’d be useful.

The main reason I haven’t done it is that there are too many prepositions. So far it’s been too tedious to come up with say phrases for all of them:

“You head north.”

“You see a light to the north.”

“You see movement in the north.”

“You see movement out the window.”

“You see a light shining in through the window.”

“Bob enters through the door.”

“Bob comes in from the foyer.”

“You head towards the door.”

“Bob comes out the employee entrance.”

“Bob heads out the door.”

“A strange man bursts out of the closet.”

“Bob looks towards the north.”

“Bob goes up the stairs.” [stairs and windows can act like doors!]

All slightly different, and hard to predict which to use with which combinations of objects, locations, doors, and rooms.