Vehicles to separate part of map. (separate regions only accessible by vehicle)

I am new to Inform7. I am trying to create a vehicle that will travel to separate parts of an game map that would only be reachable by car.

A basic test example should look something like this:

You are in your driveway infront of your home.
There is a red Ferrari here.

enter car
you enter the red ferrari.
drive to the beach.
you drive through the beautiful countryside until you reach the beach.

You are in a parking lot near a beach. The beach is east of the parking lot.

At this point the player is in a separate region where other rooms can be accessed by walking once the car is exited. To get back to the original room the player would have to be in the car and type something like: “Drive home” or “Drive the car home” etc…

I would want to make the game have several separate regions that can only be driven to then be explored on foot using N,S,E,W after leaving the vehicle.

Are there any examples of games coded this way or any tips anyone can think of?
Thank you,

You can just not have the rooms connected, e.g. (untested)

"Drive test"
home is a room.

parking lot is a room. east of parking lot is beach.

An example would be 9:05 by Adam Cadre.

A map area is a kind of concept.
The beach is a map area.
The home is a map area.
The downtown is a map area.

A map area has a room called the destination.
[Fill in the "destination" property of each area here.]

Driving to is an action applying to one thing.
Understand "drive to/-- [any map area]" as driving to.

Check driving to a map area when the destination of the noun is the location (this is the can't drive to where you already are rule):
    say "You're already there!" instead.

Check driving to a map area when the player is not in the car (this is the can't drive without a car rule):
    if the car is touchable:
        try entering the car;
    if the player is not in the car, say "You can't drive without a car." instead.

Carry out driving to:
    move the car to the destination of the noun.

I’ve never seen concept used before—what does it apply to? Just locations, or other kinds too?

Basically, there are two main types of “object” that authors will want to make subtypes of: “things” are part of the model world, they have a location and can be touched and moved around, and “concepts” are not.

They’re new in the latest version of Inform 7, but if you don’t have that version, you can easily backport them. Because this is the entire definition of a “concept”:

A concept is a kind.
A concept can be privately-named or publicly-named. A concept is usually publicly-named.

That “publicly-named” part tells Inform that players should be able to type the names of concepts and have them be recognized, just like with things. But it doesn’t share any of the other properties of things—it’s just a generic type for you to extend however you like.

1 Like

Thank you all for the replies. Could someone show me an example where the “concept” feature is not used and the separate region cannot be taken to by walking in a direction?

This synthesizes my and @Draconis’s code.

home is a room.
parking lot is a room. east of parking lot is beach.

Driving to is an action applying to one thing.
Understand "drive to/-- [location]" as driving to.

Check driving to a map area when the destination of the noun is the location (this is the can't drive to where you already are rule):
    say "You're already there!" instead.

Check driving to a map area when the player is not in the car (this is the can't drive without a car rule):
    if the car is touchable:
        try entering the car;
    if the player is not in the car, say "You can't drive without a car." instead.

Carry out driving to:
    move the car to the destination of the noun.

However, with this code, the player can drive wherever they wish, including the beach (which it seems that you don’t want to happen). If you want to only have the player be able to drive from home to the parking lot, use @Draconis’s code instead.