Extensions and Unlisting Rules

I’m not very familiar with extension-writing conventions, but it seems to me that unlisting rules should be avoided, because it may cause large, unexpected changes to the parts of the game that the extension doesn’t cover. Is this so?

I’m writing an extension for various animals, and I’ve run into two situations that seem iffy:

First, you should be able to give toys and treats to your pets, but that would require unlisting the block giving rule.

Second, you should be able to pick up small animals like cats, but that would require unlisting the can’t take other people rule.

The latter is simple enough; define certain animals as “small” and say you can only take small animals; this works because the game is unlikely to have already replaced the can’t take other people rule with its own variant. But it’s perfectly likely that a game has already replaced the block giving rule with its own algorithm for whether people accept gifts or not and you don’t want to wipe that out with your own rule.

How do people typically handle modifying rules in extensions?

I think you’re definitely right that your extension should include both giving and taking behavior. I would recommend that you replace the block giving and can’t take other people rules with your own variants that allow interaction with animals, while keeping the old behavior for everything else. Explain in your documentation what your users will need to do to delist your variant. This will be only a very minor annoyance–if that–since authors will be able to use their own logic completely intact, only needing to change the name of the rule they delist to the name of your new rule.

An example:

[code]The block giving to all but animals rule is listed instead of the block giving rule in the check giving it to rulebook.

Check an actor giving something to (this is the block giving to all but animals rule):
unless the second noun is an animal:
stop the action with library message giving it to action number 3 for the second noun.[/code]

Incidentally, another solution would be to delist nothing, and to do something like this instead:

Check an actor giving something to an animal: ignore the block giving rule.

This by far the easiest way to do it, but the ignore…rule phrase is deprecated. (To my mind, this is an unfortunate byproduct of the removal of procedural rules. I don’t think that the ignore phrase actually makes use of the procedural rules machinery, but even if it does, Ron Newcomb has shown that it isn’t necessary to use anything to do with procedural rules in order to selectively and dynamically delist rules. OK, end of rant.)

–Erik

Won’t this lead to a problem if the game has its own alternate giving rules, also listed in place of the block giving rule?

I don’t think that’s a big deal. If you explain in your documentation what you’ve done, the author can modify her existing rule as needed to accomodate your logic. Any author that can write her own blocking rule can figure out how to make her code work with yours.

This is really your only avenue, since the library requires that you actively hack it to provide interesting behavior. If you hack the library in one way and an author hacks it in another, those hacks simply have to be reconciled, and that reconciliation is ultimately the author’s responsibility.

–Erik