Disambiguating user input referencing a common object

I’m trying to make life easy for the player here but struggling with disambiguation.
The player awakes in a cryogenic stasis chamber and needs to get out of it. There are several chambers in the room (part of a later plot element) and I have named them here, stasis chamber 1, stasis chamber 2 and stasis chamber 3 but I’d like the player to simply have to type “get out of the stasis chamber” rather than having to add a number (at this stage they may not even be aware that there are more. It feels more normal from the players perspective.

My simplified script is,

Cryo Storage is a room. 
Stasis chamber 1 is a container in Cryo Storage. It is enterable and fixed in place. It is scenery. The description is "Description of cryo storage 1." The player is in stasis chamber 1. 
Stasis chamber 2 is a container in Cryo Storage. It is enterable and fixed in place. It is scenery. The description is "Description of cryo storage 2."
Stasis chamber 3 is a container in Cryo Storage. It is enterable and fixed in place. It is scenery. The description is "Description of cryo storage 3"

Understand "stasis chamber" as stasis chamber 1.

Every turn when the player is inside the stasis chamber:
	say "You should probably [italic type]get out of the stasis chamber[roman type]."

Getting out of is an action applying to one thing. Understand "get out of [something]" as getting out of. 

Understand nothing as exiting.

Instead of getting out of the stasis chamber:
	move the player to Cryo Storage, without printing a room description; 
	say "You get out of the stasis chamber...";

test me with "get out of the stasis chamber / get out of stasis chamber 1."

I thought the Understand “stasis chamber” as stasis chamber 1 would do the trick but no. When I try this it prompts me, Which do you mean, Stasis chamber 1, Stasis chamber 2 or Stasis chamber 3
Is there a work around?

1 Like

See chapter 17.19. You can write a “does the player mean” rule to prefer exiting a container that the player is currently in.

Does the player mean getting out of a container (called C):
	if the player is in C:
		it is very likely.
2 Likes

Also, the way you have it set up, the rule

Instead of getting out of the stasis chamber:

…only applies to one of the chambers, and it’s accidental which one. You’d be better off defining a kind of container and then saying “Instead of getting out of a stasis chamber:”.

2 Likes

Thank you Andrew…it didn’t occur to me to move to using a kind when I increased the number of stasis chambers. The changes you suggested appear to have got things working so let me reintegrate that into my main code.
Thanks for the super quick response too!