Setting default adjectives

Hi,
Trying my first Inform7 game here. Can someone please tell me why this isn’t working?

Understand the command "clean" as something new.
Cleaning is an action applying to one thing.
Understand "clean [something]" as Cleaning.

Cleanly is an adjective.
Dirty is an adjective.
An object can be cleanly or dirty.
An object is usually cleanly.
An object is cleanly unless it is dirty.

Instead of cleaning an object when it is cleanly, say "It already is.".
Instead of cleaning an object when it is dirty, say "you'll have to talk me through that".

The issue: Let’s say I have a door, a mat and a key. The mat is the only thing with the adjective “dirty”. The problem is the door and the key show up as “dirty” in “showme” as well. I would like all things to be “cleanly” unless they are designated “dirty”. I’ve tried re-phrasing this so many ways but keep getting errors.

Any help is appreciated.
Thank you all for any help you can provide in advance!

Inform already knows how to handle properties, so you don’t need to manually tell it something is an adjective (in fact “adjective” isn’t a concept that’s built in by default so this approach will confuse the compiler) - for that portion of the code, all you need to do is:


An object can be cleanly or dirty.
An object is usually cleanly.

(You should delete the other three lines in that code block).

The other issue you’re running into is in your rule preambles - “it” is also too vague in this context, so they should be of the form “instead of cleaning something when the noun is cleanly/dirty” (“the noun” is how Inform keeps track of the object of an action).

Hope this helps!

EDIT: here’s the part of the documentation about creating what’s called an either/or property, which is what you’re doing here:

https://ganelson.github.io/inform-website/book/WI_4_7.html

2 Likes

Or, if you like, “Instead of cleaning a dirty thing…”

2 Likes

Thank you Mike. Thank you Andrew.

Ultimately I think whatever I tried first (similar to the solution above) didn’t work and so I ended up overthinking it.

Interesting concept about “when the noun is cleanly/dirty” as obviously those are not nouns, but then I realized what is really being said by that sentence is, “when the noun that was stated by the user in the entry has the current condition of being cleanly/dirty”.

Anyway, it seems to be working now and I can move on. I’m sure I’ll be back when something else pops up later in the project.

Much obliged!

2 Likes