I keep changing my mind about how to redirect action in a check rule. I’m trying to formulate some principles.
Occasionally I use the “convert” phrase like the Standard Rules does. I feel like I’m messing with something I don’t understand, but it looks like something that’s built to handle just this situation.
Other times I just want to change the noun or the second noun, so I do that without changing the action.
The rest of the time I use a “try” phrase.
I’ve had issues in testing with various methods, so I’d like to try to make the differences plain. I’m guessing at some of this, so let me know if I’ve missed anything or made any mistakes.
A “try” phrase invokes ALL the relevant rules for the new action. So if the source says “instead of taking the red ball” and your code says “try taking a random ball that is in the box,” that might be invoked some times.
Changing nouns continues the current rulebook, so if the action was originally taking the box, the Instead rule will never run. In fact a “check taking the red ball” would not apply if it was listed before the rule that changed the noun.
I’m not really sure if “convert” runs all the rulebooks that “try” does - I’ve never looked into it.
I know that I’ve had situations where I really don’t want to run all the rules for the new action, but I can’t remember what they were. But dealing with this sort of complicated rule interaction has made me extremely wary of Before rules. They almost always end up preempting some important Instead rules.
I try to avoid using Instead rules when more than one object might be affected, especially in extensions, but sometimes I want to catch a lot of different actions. Lately I’ve been experimenting with adding the same rule to multiple check rulebooks instead. But there are still times, even in extensions, when I decide to use Instead rules. And there are still times when I regret it…
What’s your approach?