Where to put the you-enter-room-so-turn-on-radio-sound?

Hi All. I’m still cooking up little practice sessions.
This one seems like a typical scenario but I can’t find a good way to pull it off.

scene:
The cave is a room.
The forest is a room outside of the cave.
The radio is a switchable thing in the cave.

instead of switching on the radio: (<–this is just for example)
say “The radio hums and crackles, then settles into really annoying morning-radio chatter.”.

…now every time I enter the room I want to show the message “The radio is gobbling away like a turkey on fast-forward.”

Unfortunately, because the main action is ‘going-to’, the room description is always printed AFTER my message, regardless of whether I put it in the before stage or the report stage.
The only way I found this to work is to use a post-action stage like (punctuation may not be perfect):
every turn: (needs more logic to stop repeating itself but I know that)
if the radio is switched on and the location is the basement:
say “The radio blabs away like a clueless moron.”., but that seems too brute-force.

I suppose I could use a room description with decisions, but what if I put the radio in any other room? The room descriptions would get impractical.
I could use something like a [previous room] variable so that I could catch just the event of moving from elsewhere to the cave, if it existed.
There is probably some kind of phrase like [if going from somewhere to the basement] but I find all the built-in phrases hard to decode like I could with the familiar syntax of regular programming.
I can even imagine it as a rule, ie ‘the going from somewhere to the basement rule’, although I am still wrapping my head around rule definitions.
Suggestions?
thanks

Too brute-force? Seems to me that’s the standard Inform way of doing it. If you only want that message to appear (after the room description) each time the player enters the room from elsewhere, but only the first time for each visit, that’s not terribly difficult. Is that what you have in mind?

Here’s a way to do that:

[code]The Porch is a room. “You can go south to enter the house.”

The Living Room is south of the Porch. “This room is dominated by an old-fashioned cabinet radio[radio-blabbing].”

in-room-count is a number that varies. in-room-count is 0.

To say radio-blabbing:
increase in-room-count by 1;
if in-room-count is 1:
say “. [paragraph break]The damn radio is blabbing, as usual”

After going from the Living Room:
now in-room-count is 0;
continue the action.[/code]

It seems to me that you might be able to use past tense (§9.13 of Writing with Inform) to do something here. Like this:

Every turn if the radio is switched on and the radio is in the location and the radio was not in the location: say "The radio blabs away like a clueless moron."

This looks like it’s going to check whether the radio moved into the location. But past tense locutions like this just take the whole phrase and check whether it was true at the start of the most recent action–so the test is going to be “When we started this action, was the radio not in the same room as the player?” Which will be true when the player moves to the room where the radio is, or when some other funky consequence of the action deposits the player in the room where the radio is, or even when a funky consequence of the action summons the radio, as can be seen here:

[code]The cave is a room.
The forest is outside from the cave.
The radio is a device in the cave.

After switching on the radio:
say “The radio hums and crackles, then settles into really annoying morning-radio chatter.”.

After jumping when the radio is not in the location:
say “Somehow this summons the radio to you.”;
now the radio is in the location.

Every turn when the radio is switched on and the radio is in the location and the radio was not in the location:
say “The radio blabs away like a clueless moron.”

test me with “switch on radio/z/out/in/z/out/jump/z/in/out/switch off radio/in/out”.[/code]

Another option, if you only want this to apply when the player goes somewhere, would be to hook this into the going action after the rule that prints the new description–that’s the “describe room gone into” rule, which is a Report going rule, so you could write a new Report going rule and make sure it gets listed after the describe room gone into rule. That’ll let you use the action variables for going, like the room gone to and the room gone from.

(Oh, and don’t use an “Instead of switching on the radio” because then the radio won’t get switched on. Use an “After.”)

There is actually a very simple way of doing this.

Rule for writing a paragraph about the radio when the radio is switched on:
    say "your text here".

This has the added benefit of printing the text whenever the room description is shown, even if it wasn’t due to a “going” action. (E.g. if the player is teleported, or types LOOK to see the description again.)