[I7] Trouble with seating

I have a room called Front Porch-OS. In this room is a piece of scenery called the wooden swing. I want to treat the swing as a hammock, but each time I try, the program returns an error. Here’s the way I have it worded:

Front Porch-OS is a room with printed name “Front Porch”. “This covered porch is crowded with plants. They hang from the eaves, sit on shelves, and litter the ground. A wooden swing hangs from the roof.”

The wooden swing is in the Front Porch-OS. The wooden swing is scenery in the Front Porch-OS. Instead of taking the wooden swing, say “The swing is securely bolted to the roof.” The description of the wooden swing is “An antique wooden slatted porch swing supported by two rusted, but sturdy-looking chains.” The wooden swing is a hammock in the Front Porch-OS.

You need to make it an “enterable supporter”

Okay, that worked. Thanks. Now, how would I prevent someone from standing on the swing (but still enable them to sit or lie down)?

“Entering” is the actual action happening here. It is activated with the following commands:

“get in/on”
“get in/into/on/onto [something]”
“stand on [something]”
“go [something]”
“go into/in/inside/through [something]”
“enter”
“enter [something]”
“sit on top of [something]”
“sit on/in/inside [something]”

I should let someone else chime in as any fix I can think of is, I’m sure, a bit more long-winded than a more-experienced IFer can suggest.

There’s a fairly sophisticated system for this in the manual, called Slouching.

You lost me. I’ve tried putting:

Instead of standing in the swing, say “You attempt to stand on the wooden swing, but find it difficult to keep your balance.”

and

The wooden swing is an enterable supporter that allows seated and reclining. The wooden swing is usually reclining.

Both return an error.

You need at extension for that. Try Postures by Emily Short.

It’s a lot more complex than that because a) in your code, you can only refer to the action as “entering” and b) you would need to get the parser to disambiguate between “stand on” and “sit on” which it isn’t wont to do. Check out the others’ replies re: “postures”.

Where can I get extensions, please?

http://inform7.com/write/extensions/

Assuming you use the code from Slouching, it doesn’t allow “standing in” as a construction. Use “standing on”.

Again assuming you use the code from Slouching, this passage should work, except for the last part; the wooden swing is a supporter (i.e. a sub-classed instance of thing), not a kind, and saying a specific thing is “usually” x makes no sense to Inform.

Thanks, all. Still can’t get it to do custom text when trying to stand on the swing, but at least they can’t stand on it.

Most players will “sit” on your swing rather than “stand” on it, but if they do attempt to “stand” on it, they aren’t always looking for fault in your game so much as being silly. :stuck_out_tongue:

Also you should think about whether it’s really worth preventing the player from typing “STAND ON SWING.” If what matters is whether they’re in the swing or not, then it doesn’t really matter whether they got there by typing “STAND ON SWING” as opposed to “SIT ON SWING.” No need to go to a lot of trouble to make sure “STAND ON SWING” doesn’t work.

If it really matters whether they’re standing or sitting – say, they have to reach a wind chime hanging from the porch roof, they can’t stand on the swing because it’s too unstable, they have to drag a barrel over to the porch and stand on that – then you’ll need a system that distinguishes between standing on the swing and sitting on the swing, and as a few people have said, the best way to do that is to use Postures by Emily Short.

BTW, I think it might help to get a bit clearer on the difference between commands and actions. Think of the command as what the player types, like “STAND ON SWING” or “SIT ON SWING.” The game then translates that command into an action – in this case, both those commands are translated into the action of entering the swing. Any rules you want to write for actions are going to refer to actions rather than commands – so by the time you’re writing an “Instead” rule, the game is dealing with the action of entering the swing and has (mostly*) forgotten whether the player typed “STAND ON SWING” or “SIT ON SWING.”

So as MTW said, the only way your game has of thinking about that action is as “entering the swing” and you have no way of distinguishing the command “STAND” from “SIT.” If you want to distinguish those, you have to define a new action and make sure that the “STAND ON” command gets processed into that new action rather than the entering action. That’s what the Postures extension does for you. (To see more about how to do this, look at the Advanced Actions and Understanding chapters of the documentation; to map a command to an action you type something like “Understand ‘blah blah’ as fooing.” In fact, the reason that “STAND” and “SIT” are understood as entering is that the standard rules contain Understand statements mapping these commands to that actions, and the reason Postures works differently is that it has different Understand lines.)

OK that was kind of long and pedantic but I hope it was useful.

*You can look back at what was actually typed by looking at “the player’s command,” but you don’t want to get into that mess right now.

If it makes you feel better I was starting to consider doing the same thing, as there was a clear confusion on the OP’s part re Inform Actions vs Typed Commands.