Locations in other locations

I’m trying to make a game where there are multiple cities, and also buildings in the cities. Like a store in city1 and a store in city2. I also don’t want to use “inside” I want the UI to be like this.

Inside City1 is a store and a pub. To the west of City1 is City2

enter store
store code
w
City2 code

Why join the cities? I would think cities would be far enough apart where they wouldn’t be like rooms. Create each city as a standalone region and with a road that has sign “Go this way to city 2”. Going that way would open you in a new area called city 2 with its own separate rooms.

Think of it like a map. Two cities completely separate (you can’t be in both at the same time) with each having its own rooms (locations) within it.

If it’s very important to have the buildings in the cities be entered with “enter pub,” you could make them enterable containers. Though there’d be some potential issues with making sure that the player couldn’t see more than you want them to see from inside a building.

As seeker suggests, the usual way to implement something like this would be to have a sort of “town square” room for each city, with the buildings in different directions from the town square–and if there are enough buildings, you’d put in a few different connected outdoor rooms.

I know I’m plugging my own work, but I made the Easy Doors extension for this kind of thing - one-way portals to other locations that can behave like doors but don’t need to. The portals can represent things a player might enter based on how you describe them. That way you can make enterable things which lead to other rooms on the map instead of dealing with nesting containment of enterable containers.

http://inform7.com/extensions/Hanon%20Ondricek/Easy%20Doors/index.html
EDIT: Just realized this is an out-of-date version, but the current one should be in the Public Library and obtainable in the Inform IDE.

1 Like

And I thank you! It is one of the mandatory includes in all of my projects. I don’t use it for every door, but it is always needed for special situations.

1 Like

Oddly enough, I was looking at the Easy Doors extension yesterday and thinking, “that looks useful, I wonder what it could be used for”. It sounds a lot like the Scott Adams way of doing things, such as in Ghost Town where from one location you could “GO SALOON” or “GO JAIL” (although those locations mapped to north and south when returning to the first location, but it could just as easily have been “out”, leaving north and south free.)

1 Like

Another use for Easy Doors is it lets you put doors in containers. The reason that I have two rooms in Cragne Manor is that it was impossible to make the porch an enterable container with the front door inside it (and it would’ve really messed things up to include Easy Doors at the point where I realized I wanted to do that).

1 Like

You can have scenery buildings and capture the order “enter building/enter shop” and move the player by hand to the proper location.

You can have the enterable buildings in different locations and just put the in the INSIDE direction.

Also you can put several buildings in the proper cardinal directions, and use doors for them so the verb GO IN is avaiblable.

Good luck!

1 Like

That’s basically what my extension does.

I would second the suggestion of just using regions.

Oh darn. Teach me to look and see how old a thread is before replying, eh? But if you’re still working on your project @terribleAuthor, I hope this little demo comes in useful. I remember Emily Short producing a system for implementing public transport, so the good bits are probably half-remembered from there. At any rate, spending an afternoon catching my thumbs in the scene changing machinery has certainly helped me!

So without further ado:




Book Going by room

[ex. 306 Misadventure to allow travel to a named room]

Understand "[any room]" as going by name. Understand "go to [any room]" as going by name.

Going by name is an action applying to one thing.

Check going by name:
	if the noun is the location, say "You're already in [the location]." instead;
	if the noun is not adjacent and the noun is unvisited, say "That noun did not make sense in this context." instead.
	
Carry out going by name:
	let aim be the best route from the location to the noun, using doors;
	if aim is not a direction, say "You can't think how to get there from here." instead;
	say "(heading [aim])[command clarification break]";
	try going aim;
	if the location is not the noun, say "You'll have to stop here."
	

Book the Bus

[ see also ex.144 Empire, for a train connecting different cities]

A bus stop is a kind of room.

[Inform automatically puts the player in the first room mentioned in the source code. If that's not where you want the game to begin, you can override it using:]
The player is in dolmen square. 

To say bus-destination: 	[you don't have to hyphenate this sort of thing, I just find it a handy convention]
	if the location of the country bus is dolmen square:
		say "Stuffold";
	if the location of the country bus  is stuffold:
		say "Crickmanleigh";
	if the location of the country bus  is Crickmanleigh:
		say "Porthaven";
	if the location of the country bus  is Porthaven:
		say "Dolmen Square";
	



The country bus is an enterable container. The country bus is in Crickmanleigh.The description of the country bus is "[bus-description]". Understand "334", "diesel", "single", "deck/decker", "green bus" or "gold" as the country bus.

The initial appearance of the country bus is "Rumbling gently to itself, a green and gold Country Bus waits for passengers."

[The description is complicated because we want to vary it. I could write it using text subs, but I find I mess up less if I break it out so I can see the logic better. You don't have to hyphenate this sort of thing, I just find it a handy visual clue. If "bus-description" appears in the game text, I'll recognise that something's gone clunk somewhere.]

To say bus-description:
	if the player is inside the country bus:
		say "Austerely comfortable seats in a vivid green and gold checker pattern for the most part. The driver sits up front in a separate little cubby, screened from where you're sitting.";
		if bus travelling is happening:
			say " Outside, scenery whizzes past the window.";
		otherwise:
			say " Outside, you see [the location of the country bus].";
	otherwise: 
		say "A single-decker diesel bus, painted dusty forest green and gold. Next to the route number 334, the destination board reads '[the next stop]'.";
			

The folding door is part of the country bus. The folding door can be open. Understand "bus door" as the folding door.

Understand "board [something]" as Entering. [just so "board bus" is understood.]

to say random-passenger-alights:
	say "[one of]two elderly ladies get out[or]a day tripper alights[or]a dumpy woman in a headscarf gets out[or]a man helps a young woman with a pushchair get out[at random]. [run paragraph on] ";
	
	
Waiting for a bus is a recurring scene. Waiting for a bus begins when the location is a bus stop and the country bus is not in the location. Waiting for a bus ends when bus arriving begins. Waiting for a bus ends fruitlessly when the location is not a bus stop. Waiting for a bus ends well when the player is in the country bus.
[We have to explicitly end this scene, or when the player returns to dolmen square, the waiting for a bus scene may have been running for longer than three minutes (= turns) and so will never trigger the "bus arriving" scene. "ends fruitlessly" can  be "ends anything you like" so long as  the first word is "ends".]

The next stop is a bus stop that varies. [because we made bus stop a kind of room]

To set the next stop:
	if the location of the country bus is dolmen square:
		now the next stop is stuffold;
	else if the location of the country bus is stuffold:
		now the next stop is crickmanleigh;		
	else if the location of the country bus is crickmanleigh:
		now the next stop is porthaven;
	else if the location of the country bus is porthaven:
		now the next stop is dolmen square;
														
														
Bus arriving is a recurring scene. Bus arriving begins when the location is a bus stop and the player is not in the country bus and time since waiting for a bus began is three minutes. Bus arriving ends when bus travelling begins.

When bus arriving begins:
	now the country bus is in the location;
	set the next stop;
	now the folding door is open;
	say "With a low grumble of diesel, bus no. 334 pulls into [the location] and halts with a hiss of air brakes. After a moment, the door folds open and [random-passenger-alights] The driver reaches up and rolls the destination board to read [next stop]."
	

Bus travelling is a recurring scene. Bus travelling begins when the player is in the country bus and the location of the country bus is not the next stop. Bus travelling ends when bus leaving begins.

When bus travelling begins:
	now the country bus is in the next stop;
	say "You take a seat as the engine grumbles to life.[line break]'Any more for [next stop]?' the driver shouts. Receiving no reply, she claps the bus door shut. [paragraph break]The bus rumbles through unfamiliar countryside for a while, and you amuse yourself making up life histories for the other passengers. After a while, the you see some building that could be [next stop]. Sure enough, the bus rumbles to a halt and the doors hiss open.[paragraph break]The driver shouts: '[location of the country bus]! Everybody off!'";


Bus leaving is a recurring scene. Bus leaving begins when the next stop is the location of the country bus, and the player is not in the country bus.

When bus leaving begins:
	remove the country bus from play;
	say "Abruptly it claps its doors shut, and with a grumble of exhaust, pulls out of [the location] and disappears from sight.";
		
Book Geography

Dolmen square is a bus stop. "The center of village life, with its duckpond and a fringe of small shops facing one another across the lumpy grass where, in the summer, locals valiantly attempt cricket against the neighboring villages of Stuffold and Crickmanleigh, and townies from Porthaven come to browse the antique shops and lunch in the Jolly Adventurer."


The pub is scenery in Dolmen square. The description of the pub is "Carefully olde-worlde, the [italic type]Jolly Adventurer[roman type] sits directly across the square from [italic type]Piltdown Antiques[roman type] and the local Post Office." Understand "olde" or "worlde" or "Jolly" or "Adventurer" as the pub. Instead of entering the pub, try going west.


The antique shop is scenery in Dolmen square. The description of the antique shop is "Cramped in a narrow row of shops, it seems to offer antiques to suit every budget." Understand "piltdown" or "antiques" as the antique shop. Instead of entering the antique shop, try going east.


The Jolly Adventurer is west of dolmen square. "Bright horse brasses, a low, oaken-beamed ceiling and the whiff of old beer. Through the olde-worlde glass of the bow window, you can just make out the rough grass of Dolmen Square." Instead of exiting from the jolly adventurer, try going east.

The post office is scenery in dolmen square. "A shop frontage built onto a charming little cottage. Although a large red 'Post Office' sign stands outside, the blinds are drawn down in the shop windows, and the door between them displays a large 'CLOSED' sign." Instead of entering the post office, say "The post office seems to be closed at the moment." Understand "cottage", "shop" or "charming" as the post office.

Piltdown Antiques is east of dolmen square. "Antique furniture obstructs your passage whichever way you turn, and smaller antiques clutter every surface. A large sign reads [italic type]'What you break, you buy'[roman type]. Through the dusty window glass, you can make out the [italic type]Jolly Adventurer[roman type] on the other side of the square." Instead of exiting from piltdown antiques, try going west.


Stuffold is a bus stop. "There's not much to do in Stuffold: the locals rate 'waiting for a bus' as the most exciting thing to do here."

Crickmanleigh is a bus stop. "The guide describes Crickmanleigh as 'rural idyll' and the cottages do seem worthy of a chocolate box. The Post Office appears to be closed, but the cafe next door is open."

The country cafe is north of crickmanleigh. "All dinky little tables and chintz, chintz, chintz."

Porthaven is a bus stop. "The bustling city of Porthaven surrounds you, with places to visit aplenty, and strangers eager to make your acquiantance. [line break]Or you could always wait for a bus."
										

Feel free to tinker and use. :smile:

1 Like