Instead of listening when

Does “instead of listening when” not behave the same as “instead of smelling when”?

[code]Instead of smelling in the Lunar Module when the player is not wearing the spacesuit:
say “The air-scrubbers do a good job of clearing the LM of any smell at all.”.

Instead of listening in the Lunar Module when the player is not wearing the spacesuit:
say “The ambient noise of the air-scrubbers fills the room.”.
[/code]

Isn’t the action called “listening to”? (Just off the top of my head, I don’t have Inform open right now.)

Yes.

Right, if there were a specific thing I was referring to listen to. In this case, I am not. I’m trying to use “Listen” to listen to everything within the room. “Smell” and “Look” both behave can behave this way as default, but “listen” doesn’t seem to.

For this story, I only need for listen to return 1 strand of text per room, with a variable of if the player has the space suit on or not.

The action is called ‘listening to’ whether it takes a noun or not. Smelling also works this way (it’s just called ‘smelling’ rather than ‘smelling to’, because you don’t listen music or smell to flowers).

Instead of listening to in the Echo Chamber: say "[if the player wears the space suit]All you hear are space-suity beepings.[otherwise]You hear all kinds of stuff.[end if]["

Technically I think that listening to always takes a noun – when you type “listen” you wind up listening to the room you’re in, by default. (Turn actions listing on and try listening to see what I mean.) Smelling is the same.

This won’t work as expected if the player is in/on a container/supporter in The Echo Chamber. Try this.

Instead of listening to the Echo Chamber: say "[if the player wears the space suit]All you hear are space-suity beepings[otherwise]You hear all kinds of stuff[end if].".

The built in ambient sound rule will take care of the rest.

Hope this helps.

Hm? Yes it will. If the player is on a table in the Echo Chamber, the player is still in the Echo Chamber.

This is different from what was requested. This only covers “listen”, not “listen to X”.

You’re right! I muddled that with this.

Instead of listening to when the player is in the Echo Chamber: say "[if the player wears the space suit]All you hear are space-suity beepings[otherwise]You hear all kinds of stuff[end if].".

This would cause the problems I mentioned.

Oh, I see. Yes, that’s correct (and somewhat confusing). “…when in X” is not the same as “when the player is in X”.

(It’s approximately the same as “when the player is enclosed by X”. I’m not sure if that’s universally true but I don’t see a simple counterexample either.)

I wasn’t able to confirm whether “when in X” and “when the player is enclosed by X” are identical or not, since I couldn’t find that bit in the source code, but they do appear to be so.

However, on a more general note, if this doesn’t work,

Instead of listening in the Seashore, say "The song of gulls.".

then why does “7.7. The other four senses” in the Inform 7 Documentation give it as an apparently “valid” example?

Documentation bug.

EDIT-ADD: inform7.com/mantis/view.php?id=566 , fixed in the next release.

Thanks, everyone. This is the working code:

Instead of smelling when the player is wearing the spacesuit, say "Wearing the space suit, you can smell nothing.".

Instead of listening to the Lunar Module when the player is wearing the spacesuit, say "Wearing the space suit, you can hear nothing but the gases passing through your suit that allow you to breathe.".

It is kind of weird, but does make sense that you have to listen to the “room” itself. Good work on confirming this as a documentation bug and submitting it, Zarf. I was indeed trying to do this straight from documentation.

I tried “Instead of listening to something” as well, but the compiler didn’t like that.

Oh, I didn’t submit it. It was submitted more than a year ago, after this forum thread: https://intfiction.org/t/problem-with-the-other-four-senses-listen-in-a-room/1750/1

Ah, gotcha. Well thanks nonetheless.