It is possible to limit your rules to putting it under. You’d say “before putting a sub thing under” or “before putting a sub thing under something”. There’s a subtle distinction in the case where you have a rule for supplying a missing second noun, but you probably don’t need to worry about that now. I’d go for the former if in doubt.
Generally, there’s nothing wrong with modifying an action that already exists, so long as you understand its current behavior. It’s often helpful to look at the information in the Actions Index for a given action and to open up the standard rules (File → Open Installed Extension → Graham Nelson → Standard Rules) and search for it.
In this specific instance, I don’t understand the purpose of the two rules that you wrote. Note that the similar rules in my example were for the pushing action (already defined) and not the pushing it under action (which we defined). The idea was that vague movement via “move ” or “push ” of a sub thing would move it out from under its uber and make it no longer under anything. The ‘old uber’ action variable exists because, by the time the report rule runs (that says “You move the out from under the ”), the relation has already been severed by the ‘after pushing a sub thing’ rule.
In the example, ‘old uber’ is defined as an action variable (see §12.10) for the pushing action. This error means that you’re trying to use it in a different action.
IIRC, I7 won’t let you have action variables with the same name for two different actions, so, if you do define it for putting, you’ll need to give it a different name. However, I don’t know why you’d need it. Putting requires that the noun be held, which means that it won’t be under anything, which means that it will have no uber to save. I could see it being useful for the taking action, though, if you wanted “You remove the from under the ” instead of “Taken”.
If you did this, it would use all of the check rules for the pushing it under action, not all of which are appropriate for putting something under something (e.g., the one about the noun being carried by the player).
If, by uberistic, you mean something under which something else can be put, then I think that, despite my code comment about “need a flag (and a check rule)”, we get this for free with the coverage capacity property.
Definition: a thing is uberistic if its coverage capacity > 0.
After defining this, you can write rules about uberistic things. The check rule that I wrote in my previous post, with the embedded conditional about whether coverage capacity is 0, gives us most of what we need (it won’t let something be pushed under a non-uberistic thing), but it could perhaps be made clearer with this definition.
Here’s a simple example of two actions sharing a rulebook for checking.
Section 1 - Foobar Rules
The foobar rules is a rulebook.
A foobar rule when the noun is scenery (this is the can't foobar scenery rule):
instead say "[We] [can't do] that to [the noun], because it's scenery." (A).
A foobar rule when the turn count is odd (this is the can't foobar on odd-numbered turns rule):
instead say "[We] [can't do] that to [the noun] right now, because the turn count ([turn count]) is odd. Try again soon!" (A).
Section 2 - Fooing
Fooing is an action applying to one thing.
Understand "foo [something]" as fooing.
Check fooing (this is the check fooing rule):
abide by the foobar rules.
Report fooing (this is the report fooing rule):
say "[We] [foo] [the noun]." (A).
Section 3 - Baring
Baring is an action applying to one thing.
Understand "bar [something]" as baring.
Check baring (this is the check baring rule):
abide by the foobar rules.
Report baring (this is the report baring rule):
say "[We] [bar] [the noun]." (A).
Section 4 - Verbs
To foo is a verb.
To bar is a verb.
Section 5 - Status Line
When play begins:
now the right hand status line is "Turns: [turn count]".
Section 6 - Living Room
Living Room is a room. "This is the living room. There's a window on one wall."
The window is scenery in the living room.
The chair is an enterable portable supporter in the Living Room.
Section 7 - Tests
Test me with "foo window / bar window / foo chair / foo chair / bar chair / bar chair".
You may have noticed that I cheated a bit and avoided using the name of the action in the output, instead using the vague phrasing “You can’t do that”. I did this to simplify the example. Here’s a way to fix that. This replaces sections 1 and 4 of the above example:
Section 1 - Foobar Rules
The foobar rules is a rulebook.
The foobar rulebook has a verb called the current verb.
First foobar rule (this is the set the current verb rule):
now the current verb is a random verb that describes the action name part of the current action.
A foobar rule when the noun is scenery (this is the can't foobar scenery rule):
instead say "[We] [can't] [infinitive of the current verb] [the noun], because it's scenery." (A).
A foobar rule when the turn count is odd (this is the can't foobar on odd-numbered turns rule):
instead say "[We] [can't] [infinitive of the current verb] [the noun] right now, because the turn count ([turn count]) is odd. Try again soon!" (A).
Section 4 - Verbs
[See example 250: History Lab]
Describing relates various verbs to various action names. The verb to describe means the describing relation.
To foo is a verb. The verb foo describes the fooing action.
To bar is a verb. The verb bar describes the baring action.
For cutting and pasting convenience, here’s the full program with the replacement code substituted in:
[rant][code]
Section 1 - Foobar Rules
The foobar rules is a rulebook.
The foobar rulebook has a verb called the current verb.
First foobar rule (this is the set the current verb rule):
now the current verb is a random verb that describes the action name part of the current action.
A foobar rule when the noun is scenery (this is the can’t foobar scenery rule):
instead say “[We] [can’t] [infinitive of the current verb] [the noun], because it’s scenery.” (A).
A foobar rule when the turn count is odd (this is the can’t foobar on odd-numbered turns rule):
instead say “[We] [can’t] [infinitive of the current verb] [the noun] right now, because the turn count ([turn count]) is odd. Try again soon!” (A).
Section 2 - Fooing
Fooing is an action applying to one thing.
Understand “foo [something]” as fooing.
Check fooing (this is the check fooing rule):
abide by the foobar rules.
Report fooing (this is the report fooing rule):
say “[We] [foo] [the noun].” (A).
Section 3 - Baring
Baring is an action applying to one thing.
Understand “bar [something]” as baring.
Check baring (this is the check baring rule):
abide by the foobar rules.
Report baring (this is the report baring rule):
say “[We] [bar] [the noun].” (A).
Section 4 - Verbs
[See example 250: History Lab]
Describing relates various verbs to various action names. The verb to describe means the describing relation.
To foo is a verb. The verb foo describes the fooing action.
To bar is a verb. The verb bar describes the baring action.
Section 5 - Status Line
When play begins:
now the right hand status line is “Turns: [turn count]”.
Section 6 - Living Room
Living Room is a room. “This is the living room. There’s a window on one wall.”
The window is scenery in the living room.
The chair is an enterable portable supporter in the Living Room.
Section 7 - Tests
Test me with “foo window / bar window / foo chair / foo chair / bar chair / bar chair”.
[/code][/rant]
As a final note, I’m still not happy with the ‘rule for writing a paragraph about a thing’ from my previous post. It has too many caveats. I think we could do something better, perhaps using the ‘marked for listing’ status of the various items (assuming that it’s set or not set early enough). I need to take a closer look at §18.26 and the corresponding code in the standard rules.
Me too!