Block or rewriting standard rules

Let me ask the question different way – from looking at the standard rules, how do I tell what the name of this rule is and block it (example chosen at random):

Check an actor taking (this is the can't take component parts rule):
  if the noun is part of something (called the whole):
     if the actor is the player:
        say "[regarding the noun][Those] [seem] to be a part of [the whole]." (A);
     stop the action.

The key is the first line.

Check an actor taking (this is the can’t take component parts rule):

This is the can’t take component parts rule. All rule names end in “rule”. So:

The can't take component parts rule does nothing.
4 Likes

Thanks, Draconis. You always help as well!

1 Like

Btw, you can also block rules in particular circumstances only, which is powerful. I didn’t know this for a long time and was doing annoying work like deactivating a standard rule, writing a replacement including exceptions (often for a single prop), then putting the replacement in place.

Reworking the current example, let’s pretend you want the game to block taking components in general (like Inform’s normal setup), but there’s a robot whose head you do want to allow them to take.

You can write

The can't take component parts rule does nothing when the noun is the robot's head.

or, similar but not the same,

The can't take component parts rule does nothing when taking the robot's head.

etc., phrasing it to get whatever particular freedom or restriction you need.

You can write as many such lines as you like.

-Wade

3 Likes

Thank you, Wade!

Slight caveat with this. If you decide to relist the rule somewhere else, the relisted rule will not work. You can get around this by just unlisting the rule from the relevant rulebook, like so.

The can't take component parts rule is not listed in the check taking rulebook.
1 Like

Thank you!

I tried this with about five different ways of coding but cannot change the functioning of the unlock without a lock rule.

I have a cardboard box that is taped shut. The natural syntax of opening the box would be something like: “open cardboard box with scissors”. I have defined a new verb of tapecutting but that can only be used with “split the tape with scissors” or “cut the tape with scissors” (or their synonymic equivalents.

I have tried these ways to change the functioning of the rule. Some will compile, some will not but the results is always the same – “That doesn’t seem to be something you can unlock.”

I have tried:

The can't unlock without a lock rule does nothing when opening cardboard box.

The can't unlock without a lock rule does nothing.

Block the can't unlock without a lock rule when opening cardboard box.

Block the can't unlock without a lock rule.

The can't unlock without a lock rule does not exist in any rule book.

I have also tried creating a new action, which compiles but does not work:

opening with is an action applying to two things.  understand "open [something] with [something]" as opening with.

check opening with:

etcetera etcetera, I don’t think I need to post the entire code.

I’ve coded it about every way I can think of. Suggestions are appreciated!

Ah, was this unlocking thing the original (indirect) focus of your query about blocking or rewriting standard rules?

The biggest fix or improvement most authors can make to Inform’s standard locking code is by including Emily Short’s Locksmith extension. It even helps in games that aren’t using locks. So before tackling a series of problems involving activating, deactivating rules and creating new actions, I would set all that aside and just include the extension in your game. You will have to read the docs but I expect ultimately you’ll find it easier to get what you want once the extension’s in place. For typical use cases, it probably supports whatever you want to do out of the box. Then if you still have problems, we can reinvestigate.

-Wade

1 Like