# Can't unlock without a lock rule - overriding?

New puzzle! Rulebooks! Woohoo! Yes, I’m working my way slowly through the manual. Anyway! I have an object which I need my player to figure out they need to disassemble or open in order to be able to add another component to it (as per my last question haha). Anyhow, I did this using the following:

``````Disassembly is a rulebook.
A disassembly rule: if the noun is disassembled, say "That's already disassembled." instead.
A disassembly rule:
if the noun is a fleeb:
unless the noun is carried, try taking the noun;
if the second noun is nothing, say "You can't open the fleeb with your bare hands." instead;
unless the second noun is the tool:
say "You can't disassemble the fleeb with that." instead;
otherwise:
say "You pry open the fleeb with your tool.";
now the noun is open;
now the noun is disassembled.

Opening it with is an action applying to two carried things.
Understand "open [something] with [something]" as opening it with.
Understand "disassemble [something] with [something]" as opening it with.

Check opening it with:
if the noun is a fleeb:

Some of this works. If I try ‘open fleeb’ it does in fact say ‘You can’t open the fleeb with your bare hands.’ BUT, if I say ‘open fleeb with tool’ it says (with rule tracing on):

So I’m guessing that the ‘can’t unlock without a lock’ rule is firing before my ‘instead of opening a fleeb with something’ rule. How do I move mine before the can’t unlock etc. rule? I’d rather not nuke that from the rulebooks entirely. I tried making my ‘instead of opening a fleeb with something’ into ‘before opening a fleeb with something’ but that didn’t help.

Any pointers gratefully appreciated. You guys rule.

The Standard Rules already define “open [something] with [something preferably held]” as unlocking it with. Your definition doesn’t override that by default. So, OPEN FLEEB WITH TOOL still triggers the unlocking it with action.

Putting the wanted behaviour inside an ‘instead of unlocking a fleeb with something’ rule ought to work.

(The debug command “actions” will trace actions much as “rules” traces rules.)

You’ll need to get rid of the “open [something] with [something]” -> unlocking grammar line.

IIRC, you’ll need to ‘understand “open” as something new.’, then put in the appropriate “understand” lines.