The problem is that “the thing” doesn’t refer to the thing you’re trying to put in the closet. In English the connection is strongly implied so a human reader understands the intended meaning but Inform takes everything literally, in this case it understands that line as “if there is a thing that is not clothing” which is always true. Instead of “thing” you need to use “noun” which refers to the object that’s being handled.
Check inserting things into closet:
if the noun is not clothing:
say "That really doesn't belong in the closet." instead.
As I understand it, one way to think of this is that I7 almost always treats “the” and “a” interchangeably (I think the main exceptions are in the handling of definite/indefinite articles when saying object names, and in some set phrases like “end the story”). So “If the thing is not clothing” compiles to the same thing as “If a thing is not clothing,” which is almost always true.
Thank you. It works. I was wondering though; do you mean that Inform believes there is a thing called clothing and only that thing can be put in the closet? Or am I completely misunderstanding you? If it is the former, why? The word clothing is already specified as a kind, so wouldn’t Inform understand the line as “if there is a thing that is not a clothing-kind” similar to how it recognizes that certain actions can’t apply to inanimate objects? I’m sorry if that’s a dumb question.
No, it’s only the wording of the phrase you used. “Thing” means “any thing at all”, but “noun” means “the thing in question”.
“if the thing is not clothing” belongs to the same group as the following:
A wolf is a kind of animal. A wolf can be hungry.
If a wolf is hungry: ... [if any wolf in the game is hungry]
Clothing is a kind of thing.
If clothing is worn by the player: ... [if the player is wearing anything]
If a door is open: ... [if any door is open]
If a person is in a container: ... [if any person is in any container]
So following this logic, and remembering that Inform generally does not make a difference between “a” and “the”,
If [the] thing is not clothing: ... [if there is a thing that is not clothing.]