Definition: A thing is invisible if it cannot be seen by the player. Definition: A thing is visible if it can be seen by the player.
Underlying relates various things to one thing. The verb to underlie means the underlying relation. The verb to be under means the underlying relation. The verb to be beneath means the underlying relation.
Instead of looking under a thing which is underlaid by something (called the lost object):
say "You find [the list of things which underlie the noun]!";
now every thing which underlies the noun is carried by the player;
now every thing which underlies the noun does not underlie the noun.
Some papers are in the Salon. The bronze key is under the papers. The bronze key unlocks the bronze locked door. The bronze key is invisible. After looking under the papers: The bronze key is visible.
Error:
In the sentence âA thing is invisible if it cannot be seen by the playerâ , you ask me to arrange for something to be âinvisibleâ at the start of play. There are some adjectives (âopenâ or âdarkâ, for instance) which I can fix, but others are just too vague. For example, saying âPeter is visible.â isnât allowed, because it doesnât tell me where Peter is. Like âvisibleâ, being âinvisibleâ is something I can test during play at any time, but not something I can arrange at the start.
So I get that. But thatâs exactly why I defined it, though?
I suspect the issue is that youâre trying to manually set the visibility/invisibility of an object, but youâve told Inform those are calculated values - like âthe bronze key is visible/invisibleâ doesnât make sense as a thing to directly set, since thatâs a consequence of where it is and where the player is.
The typical way to deal with this kind of stuff is to just keep the relevant object off-screen, and then use something like your after rule to move it into the location (or you could have it in place but not described, and/or use an instead rule to intercept attempts to interact with it before itâs been âfoundâ). And since you can just directly ask Inform whether the player can see an object, the definitions approach might also be over complicating things. But FWIW this code works the way youâd think it should:
Laboratory is a room. the papers are in laboratory. the closet is east of laboratory.
Definition: A thing is invisible if it cannot be seen by the player.
Definition: A thing is visible if it can be seen by the player.
every turn:
if the papers are visible, say "visible.";
if the papers are invisible, say "invisible."
Have you defined âlost objectâ as a kind of thing elsewhere in your code? If not, thatâs probably why youâre getting the second error.
Oh yeah. I guess I was trying to punch above my weight on this one. I put everything inside brackets and just added a simple after rule and now it works.
The key is, a definition like that is underspecified. Youâre telling Inform that something is invisible if it canât be seen by the player. But there are all sorts of reasons why something canât be seen by the playerâit could be in another room, it could be in a locked container, it could be in the dark, it could be off-stage completely. So when you tell Inform to make something invisible, wellâŚwhich of those should it be?