The contents of a vehicle / room

So, I have a car that the player can drive. My problem is that the story takes place at night. So, when the player is outside of the car, it is jarring for the game to list the contents, especially small ones, of the vehicle when the player is standing outside of the car and the small contents of the room when the player is in the car.

This is all really obvious when dealing with the car key.

Example 1: If the player leaves the key in the car (but not in the ignition) and gets out of it, this message is added at the end of the room description:

You can see the car (in which is a key) here.

I want to eliminate the “(in which is a key)” tag, but I’m having trouble pulling it off.

Example 2: If the player leaves the key outside of the car and gets in it, we see this:

You can see a key here.

This is confusing because the outside room is the road. Seeing the key there from the car (especially at night) should be impossible. It sounds like the key is in the car.

Example 3: If the player drops the key in the car while he or she is in it, you get this tag:

In the car you can see a key.

This is the least objectionable situation, but I would still prefer to modify that to something like “There is a key here.” The way it’s worded, it sounds like the player is outside of the car.

I’ve tried altering the rules for “listing contents of the car” and “possessions of the car” and “listing nondescript items” but I haven’t been able to get it right.

I also tried the bulldozer approach of making the car closeable and opaque, but the effect was just as bad. It didn’t list the items anymore, but it describes the car as “(closed)” which is awkward and then I have to deal with lighting the car from the inside and/or making separate room descriptions for inside and outside the car.

I could solve all of this by making the interior of the car a room, but then I wouldn’t be able to drive it from room to room.

I can also make each individual noun “undescribed” when it is in the car, but that sounds like a nightmare. I tried to find a way to make all items “undescribed” while they were in the car, but I couldn’t make that work either.

I feel like it’s my unfamiliarity with altering rules that’s the issue, but I’ve read the documentation and the examples there just aren’t getting me where I need to be. So, I’m at a loss. If anyone can help, I’d really appreciate it!

The “in which is a key” is part of the rule for printing the name of the vehicle. The first issue can be fixed with:

Rule for printing the name of the car:
	omit contents in listing;
	continue the action.

As for the second issue, you can choose to not list anything nondescript with this:

Rule for listing nondescript items when the player is in the car:
	do nothing instead.

Although that might not be exactly what you want.

Here’s an example with the functionality you want:

"Test Drive"

Rule for printing the name of the car (this is the omit contents in the car rule):
	omit contents in listing;
	continue the action.
	
Rule for listing nondescript items when the player is in a vehicle (called the driven vehicle) (this is the special locale description when in a vehicle rule):
	repeat with item running through things inside the driven vehicle:
		if the item is not the player:
			now the item is marked for listing;
	if the driven vehicle contains a thing that is marked for listing:
		say "There ";
		list the contents of the driven vehicle, as a sentence, tersely, listing marked items only, prefacing with is/are, including contents and giving brief inventory information;
		say " here.[paragraph break]";
	if the location contains a thing that is marked for listing:
		say "Outside [the driven vehicle], you can see ";
		list the contents of the location, as a sentence, tersely, listing marked items only, including contents and giving brief inventory information;
		say " on the ground.";
		
Boulevard is a room. "Sunny shaded rows of trees. The waterfront can be seen to the east."

Waterfront is east of Boulevard. "A lush expanse of ocean blue. The boulevard can be seen to the west."

The car is a vehicle in Boulevard.

The key is a thing in Boulevard.

The spare tire is a thing inside the car.

This provides the following result:

Boulevard
Sunny shaded rows of trees. The waterfront can be seen to the east.

You can see a car and a key here.

>enter car
You get into the car.

There is a spare tire here.

>l
Boulevard (in the car)
Sunny shaded rows of trees. The waterfront can be seen to the east.

There is a spare tire here.

Outside the car, you can see a key on the ground.

>e

Waterfront (in the car)
A lush expanse of ocean blue. The boulevard can be seen to the west.

There is a spare tire here.
1 Like

Thanks so much! I’ll try these solutions out and post the results later.

1 Like

Thank you so much to both of you! It works exactly the way I want it to now!

2 Likes