Inform 7 Home Page / Documentation


§19.5. Changing the behaviour of rules

Here is another way to abolish an already-existing rule:

The print final score rule does nothing.

The rule continues to be listed in any rulebook it would normally be listed in: but now it doesn't do anything. More usefully, we can attach a condition:

The print final score rule does nothing if the score is 0.

or:

The print final score rule does nothing unless the score is 100.

We can also substitute a rule of our own:

This is the print fancy final score rule:
    say "Oh my, you scored a mammoth [score]!"

The print fancy final score rule substitutes for the print final score rule.

and once again a condition can be applied:

The print fancy final score rule substitutes for the print final score rule when the score is greater than 100.


arrow-up.png Start of Chapter 19: Rulebooks
arrow-left.png Back to §19.4. Listing rules explicitly
arrow-right.png Onward to §19.6. Sorting and indexing of rules

*ExampleAccess All Areas
The Pointy Hat of Liminal Transgression allows its wearer to walk clean through closed doors.