Trouble with properties, kinds, and "usually"

I tried this:

A mood is a kind of value.
The moods are ecstatic, great, fine, meh, not great, bad, awful.

A mood is usually fine. [ <--  ** THE IMPORTANT PART ** ]

A person has a mood.

Spawn is a room.

When play begins:
	say the mood of the player;

It tells me I’m “ecstatic” instead of the expected “fine”. If instead I do:

[...]
A person has a mood called foo.
A foo is usually fine.
[...]
	say the foo of the player;

It tells me I’m “fine”. Is there a reason for this discrepancy? If A mood is usually fine is ignored, why is it accepted?


I also had some weird problems with other attempts at getting around this. It seems you can’t have both an unnamed and named property on the same object. This results in a compiler error:

[...]
A person has a mood. 
A person has a mood called foo.
A foo is usually fine.
[...]

Also, if I move the is usually fine after A person has a mood it breaks:

The moods are [...].
A person has mood.
A mood is usually fine.

Any pointers to the docs where I can figure out why these are happening would be appreciated.

The default value of an enumerated kind (like “mood” in your example) is always its first named option. The only way to change that for all occurrences of the “mood” kind is to reorder its definition. (You can check the Kinds Index for an overview of the default values of every kind.)

If you want to give a particular mood-valued property a different default value, you need to name the property explicitly (see §4.8. New value properties):

A person has a mood. The mood of a person is usually fine.

Also, note that you create an ambiguity by having “great” and “not great” both as named options, but the term “not great” already has the meaning of “some value other than ‘great’”, and Inform will in fact prefer that interpretation. So you wouldn’t be able to write now the mood of the player is not great because Inform would take it to mean “make the mood of the player something other than ‘great’”, which is, of course, too vague.

3 Likes

The mood of a person is usually fine.

That’s right… I remember I also tried A person's mood is usually fine. So close ><

Also, note that you create an ambiguity by having “great” and “not great”

Thanks!