Enterable supporters(chairs)

I was playing around with my practice game when I realized something odd. I have never adjusted my code to limit the number of characters(player included) allowed to sit on chairs or other furniture. Not that I ever really needed to in my games (fortunately), but in my practice/review game, I have a small chair, able to hold both the player and my NPC. How do I prohibit this, other than using

[code]Check an actor trying entering the small chair(this is the chair already occupied rule):
if a person (called the sitter) is on the small chair:
instead say “But [the sitter] is already using it! [regarding the actor][They] [step] back, embarrassed at even trying.”

Unsuccessful attempt by John entering the small chair:
if the reason the action failed is the chair already occupied rule:
do nothing.[/code]
(this second rule being for preventing a double-response)

Can I create a special ‘actor carrying capacity’ for chairs?


You could do, yes, though I don’t know it would have any advantage over your current method. Something like this:

A chair is a kind of enterable supporter.
A chair has a number called the actor carrying capacity. The actor carrying capacity of a chair is usually one.

Check an actor entering a chair when the number of people on the noun is at least the actor carrying capacity of the noun:
		say "[The list of people on the noun] [are] already sitting there." instead.

Can’t one just say:

The carrying capacity of the small chair is 1. 

As seen on this manual page? dhayton.haverford.edu/wp-content … _3_19.html

Here’s some test code that works:

The swivel chair is a vehicle.

The carrying capacity of the swivel chair is 1.

Rule for printing room description details of the swivel chair:
	do nothing instead.

A rule for reaching outside of a supporter:
	if the noun is John Diddling:
		allow access;
	if smelling:
		allow access;
		say "You'll have to get off your lazy butt.";
		deny access.

The Writer's Office is a room. The swivel chair is here. The player is here.

The bullpen is north of the Writer's Office. "Nice place. Mr. Jones keeps it that way."

John Diddling is a man in the swivel chair.

Persuasion rule for asking a John Diddling to try doing something:
	persuasion succeeds. 

Instead of smelling the Writer's Office:
	say "Stinks."
Instead of smelling the bullpen:
	say "Smells nice. Mr. Jones, the secretary, keeps it better than you keep your office."
A pen is in the Writer's office. The indefinite article is "a".

And the output from a test:

Writer's Office
You can see a swivel chair (in which is John Diddling) and a pen here.

>look at chair
In the swivel chair is John Diddling.

>get in chair
There is no more room in the swivel chair.

>John, get up
John Diddling gets out of the swivel chair.

>get in chair
You get into the swivel chair.

>john, get in chair
John Diddling is unable to do that.

>get up
You get out of the swivel chair.

Writer's Office
You can see John Diddling, a swivel chair and a pen here.

>john, get in chair
John Diddling gets into the swivel chair.


I am allowing for chairs that could also hold items, along with people; presumably there can also be something, like a sign hanging on the chair, or a pencil laying in the seat, etc., with the person also sitting there.

I just thought there might be a special function in Inform for enterable supporters to do this–such as a couch able to hold only 2 sitters, a bench seating 5, etc.


Hmmm… Something like the box that is also a supporter (which is really two things tied together. A “container” object and a “supporter” object that get used differently depending on the commands) might be a good reference. Let me see if I can dig that one up. Then you’d redirect things to say “chair seat” if it’s not a person and “chair” if it’s a person…

Here’s that box with a lid: dhayton.haverford.edu/wp-content … 5.html#e75

Yes, you could just use carrying capacity. It will block having too many things are on the chair, regardless of whether the things are people or not; my suggested code only counts people (which is what I think IFaddicted was after).

However you do it, it will take some work to get all the responses right.

Thanks to you both.