quick question, hopefully I’ve just overlooked something stupid: Why does “The envelope is a closed, openable, opaque container in MyRoom. The printed name is “envelope”.” result in “envelope” in inventory/when addressing it, not “an envelope”?
Taking your code and compiling just that, it works fine and says ‘an envelope’.
However, I get this type of bug all of the time. 90% of the time it’s because I use the word ‘envelope’ somewhere else before I properly define it.
Like if you have code like:
The paper is in envelope.
The envelope is a closed, openable, opaque container in MyRoom. The printed name is “envelope”.
Then it will assume the envelope is proper-named because you didn’t use ‘an’ or ‘the’ the first time you mentioned it. So I’d search your code for ‘envelope’, look for the first time you use it (outside of printed text) and add ‘the’ or ‘a’ to it.
If that’s not the problem, then it may be worth posting more code.
As an addendum, qualities you give a thing in the line that defines the thing will always override inferences Inform makes from other mentions of the thing, no matter what order it encounters them in.
In other words, if you change your envelope definition line to start like this:
The envelope is an improper-named, closed, openable, opaque...
then it doesn’t matter whether you first mention the envelope elsewhere without an ‘a’ or ‘an’. It will come out improper-named.
You can use this as a guaranteed method when creating things. More practically, if you need to fix something like this when it comes up, like it did with the envelope, it’s probably best to fix it by changing the defining line. Because this way of fixing is ‘order-proof’. i.e. You can reorder your code all you like and the fix will stay fixed.