Overriding adjective definitions

I’d like people to be able to override the definition of an adjective I create in my “Lost Items” extension. Currently it’s done in this rather awkward way:

[code]Section 1 - The lost adjective

Definition: A thing is lost:
follow the determine loss rules for it;
if rule succeeded, yes;
no;

Section 2 - The Determine Loss rulebook

Determine loss is an object-based rulebook. The determine loss rules have outcomes no (failure), and yes (success).

Determine loss of a known losable not visible thing:
rule succeeds;[/code]
Is there a cleaner way to do it? I tried this:

[code]Section 1 - The lost adjective

Definition: A thing is lost:
decide on whether or not the truth state produced by the determine loss rules for it;

Section 2 - The Determine Loss rulebook

Determine loss is an object-based rulebook producing a truth state.

Determine loss of a known losable not visible thing:
rule succeeds with result true.

Determine loss:
rule succeeds with result false.
[/code]
But the compiler told me:

I think you can just not do anything and it works because of the ordering of rules based on their specificity. For example:

[code][extension]
Definition: a thing is lost: no.

[story]
Definition: a pig is lost: yes.
[/code]

Also curiously enough it seems like “Definition” phrases override equally specific “To decide” phrases. You could have “To decide whether a thing is lost: no” in the extension so that the author could easily override the general case with a “Definition: a thing is lost if…” phrase.

Also, any “to” phrase can overload any other with the same preamble, so if your extension has:

To decide if (item - a thing) is lost: decide yes.

and the author writes:

To decide if (item - a thing) is lost: if the player has held the item: decide yes.

…then the latter will be used. (Rather, the latter will be used provided that it appears after the inclusion of your extension in the source code; in other words, after the initial phrase definition.)

–Erik

Personally, I think the first way is fine, and nicer from the point of view of the end user (isn’t it simpler for the author to be able to write simply “yes” or “rule succeeds” vs. “rule succeeds with result true”?). But here’s how to get the second way working:

[code]Section 1 - The lost adjective

Definition: A thing is lost:
decide on the truth state produced by the determine loss rules for it.

Section 2 - The Determine Loss rulebook

Determine loss is an object based rulebook producing a truth state.

Determine loss of a known losable not visible thing:
rule succeeds with result true.

Determine loss:
rule succeeds with result false.[/code]

The compiler message you got was due to the hyphen in “object-based”. I thought the hyphen was still optional, but apparently it now fails, at least in some circumstances. Would be nice if the error message was more helpful, though. (The bigger problem in the original was the syntax of the decide phrase itself.)

–Erik

EDITED to add: I’ve reported the unhelpful error message as a bug. Probably the solution will be to disallow the hyphenated form (which may have already been slated for the next release; I’m not sure whether these hyphenated forms were officially deprecated or not).

That has not been my experience:

[code]Include Epistemology by Eric Eve.

Test is a room.

A thing can be fooish. Foo is a thing. Foo is fooish.

Definition: A thing is known rather than unknown if it is familiar or it is seen or it is fooish.

test me with “epistat foo”[/code]

I wanted to make a rulebook that has “yes” and “no” outcomes that could be dropped into a Definition phrase, but that didn’t seem to work - I wonder if “yes” and “no” are some kind of reserved words that can’t be used as outcomes in normal rules?

I did something I’m happy with, though. I changed the name of the rulebook to “did we lose” and I gave it outcomes “we did” and “we didn’t.” The Definition still has to check the outcome, but at least the API looks nice now.

Well not in that case because your rule is not more specific than the one you’re trying to override. If you had “Definition: A foo is known rather than unknown if…” it would work. Also, if Epistemology’s rule would be a To decide rule your definition rule would override it. I don’t know why a later defined equally specific definition doesn’t override the previous one and if it’s intended behavior.

But what if you want an equally general rule that replaces the old rule?

Also, you can make a more specific definition for “a foo,” but you can’t make one for “a fooish thing:”

For some reason, this doesn’t override the original either:

A thing is known rather than unknown when it is fooish: yes.