examine something not in scope?

I have a thing that moves from room to room. I’d like to override the default messages when the player looks for it, and it’s not there.

For instance:

Carry out listening to something:
if the location of the noun is not the location of the player:
say “[the noun] is no longer in [the location]”;
otherwise:
say “From [the noun] you hear [sound of the noun].”;

But that doesn’t work, since the thing isn’t in scope, i get the default “You can’t see any such thing”

I’m also going to try wrapping all of this in something like “if the noun is seen” so the message changes whether or not the thing has been encountered already.

One thing that I found helpful is to make a backdrop with the same name as the object/creature. You can use the following to make sure the player won’t see the backdrop when the real object/creature is there:

[code]Bob is a person.

FakeBob is a backdrop. FakeBob is everywhere. Understand “Bob” as FakeBob.

Does the player mean doing something with FakeBob:
it is unlikely.[/code]

I ended up putting the thing in scope from the beginning and adding rules like this:

Before listening to something:
if the location of the noun is not the location of the player:
say “[The noun] is no longer within reach in the [the location].”;
stop the action.

Carry out listening to something:
say “From [the noun] you hear [sound of the noun].”;
now the noun is seen;

Nice! Thanks for submitting your solution after figuring it out.