Force following NPC to sit down on the other chair

I have a NPC (dog) that follows the player around, including into enterable supporters and containers.

There is one part of the game when you enter a pub, it has two bar stools. When the player sits down on a bar stool I want the NPC/dog to sit on the OTHER bar stool, not the one the player is sat at.

Is this possible? I’m a bit confused with multiple objects, I tried making them different colours but it doesn’t help, the dog still sits on your stool not the other one:

A bar stool is a kind of supporter. A bar stool is always enterable.

There is a red bar stool inside the bar.

The red bar stool is a bar stool.

There is a blue bar stool inside the bar.

The blue bar stool is a bar stool.

Instead of entering the red bar stool:
Move player to red bar stool;
Move dog to blue bar stool.

Well, this works:

"barroom" by "just testing"

The street is a room. "Dry and dusty. Just the sort of street to make you fancy a drink. Fortunately there is a saloon just to the north of where you're standing."

The horse trough is scenery in the street.

The hitching rail is scenery in the street.

The boardwalk is scenery in the street.

Patch is an animal in the street. "[patch activity]".

To say patch activity:
	if patch is on the dogstool:
		say "Patch is perched on the other bar stool, waiting for you to order.";
	else:
		say "Patch is sniffing [the random scenery thing in the location] [one of] suspiciously[or]with great interest[or]as always[at random].";


The Lone Dog Saloon is north of the street. "'Rough dive' doesn't quite capture the ambience. There's rather more spit than sawdust."

A bar stool is an enterable supporter in the lone dog saloon. "As well as the usual collection of battered furniture, there are a couple of bar stools by the counter." Understand "stools" as the bar stool. 

After entering the bar stool:
	say "With a grateful grunt, you plonk yourself down on one of the bar stools.";
	if the holder of Patch is the location:
		say "Patch looks at you a moment, one ear cocked, and then scrambles up onto the other bar stool.";
		now patch is on the dogstool.

Check taking the bar stool:
	say "It's screwed to the floor." instead.

The dogstool is an enterable supporter in the lone dog saloon. The dogstool is scenery. The printed name of the dogstool is "other bar stool".


Every turn:
	if the location of patch is not the location of the player:
		let way be the best route from the location of patch to the location of the player;
		try patch going the way;



The trouble is that (as you’ll find if you run it) now patch doesn’t actually do anything all the time that the player is on one bar stool (actually the dogstool.) Unless you have a real need for the dog to really be on the other stool (because you’re generating programmatic text or something), I’d simply fake it, by making “patch activity” sensitive to whether the player is sitting on the bar stool, and then adjusting his actions so:

"barroom" by "just testing"

The street is a room. "Dry and dusty. Just the sort of street to make you fancy a drink. Fortunately there is a saloon just to the north of where you're standing."

The horse trough is scenery in the street.

The hitching rail is scenery in the street.

The boardwalk is scenery in the street.

Patch is an animal in the street. "Patch is [patch activity]."

To say patch activity:
	if the player is on the bar stool:
		say "perched on the other bar stool, waiting for you to order";
	else:
		say "sniffing [the random scenery thing in the location] [one of] suspiciously[or]with great interest[or]as always[at random]";

The description of patch is "An arthritic and rather overweight pug. At the moment he's [patch activity]."

The Lone Dog Saloon is north of the street. "'Rough dive' doesn't quite capture the ambience. There's rather more spit than sawdust."

A bar stool is an enterable supporter in the lone dog saloon. "As well as the usual collection of battered furniture, there are a couple of bar stools by the counter." Understand "stools" as the bar stool. 

After entering the bar stool:
	say "With a grateful grunt, you plonk yourself down on one of the bar stools.";
	if the holder of Patch is the location:
		say "Patch looks at you a moment, one ear cocked, and then scrambles up onto the other bar stool.";
		[not moving patch now]

Check taking the bar stool:
	say "It's screwed to the floor." instead.

The dogstool is an enterable supporter in the lone dog saloon. The dogstool is scenery. The printed name of the dogstool is "other bar stool".


Every turn:
	if the location of patch is not the location of the player:
		let way be the best route from the location of patch to the location of the player;
		try patch going the way;



I find that having sets of objects (like in this case a set of two stools) and having the player interact with only one of them makes the code confusing: you have to tell the game to choose a random stool, and you can end up with disambiguation problems. Where possible I prefer to keep it simple and fake it!

4 Likes

Nine times out of ten, this is the best solution. Don’t forget that you are telling a story, and if you can’t get a bunch of intricate moving parts to work correctly, just tell the player what happens with narration. It’s really easy to forget this sometimes when you get wrapped up in Inform.

1 Like

Thanks both, this is really helpful. Yes it’s always a bit of a balancing act knowing what do ‘for real’ and what to fake, and where the sweet spot is.

1 Like