putting switched on message before description?

Sorry all, I know this is probably pretty obvious, but the following code for a TV:

The TV is a device in the Lounge. It is scenery. The description of it is "A large flat screen attached to the wall opposite the window. [if switched off]The darkened screen reflects the room.[otherwise]It is showing a day-time game show.[end if]"

Is great in that it works fine, but it returns:

But how do I get it to NOT show the “The TV is currently switched on” bit?

Thanks in advance.

McT

The simplest way would be removing the description and making it an “instead of examining the TV” rule, though that would block any other carry out examining, etc rules that you might be using.

This sort of thing usually comes up - how to control the default Inform text? How to we make it not appear, or change it, if we have some text of our own instead?

Rather than tell you, I’ll show you, so you know for the next time this happens. :slight_smile:

Play through your games and enter the command RULES. This will print every rule as it’s firing, and rules are responsible for making things happen.

See the last rule just before the line we want to delete? That’s the rule we’ll have to tinker with.

It’s an “examine” rule, that means it’s tied to the examining action. Go to “Index / Actions” and locate “examining”, and you’ll find it has a number of associated rules by default.

There’s also a handy button to “unlist” a rule. If you’ll ALWAYS want to control your own device responses, go ahead and click the “unlist” button for the “examine devices” rule. It’ll add the following to your code:

The examine devices rule is not listed in the carry out examining rulebook.

Ta-da, problem solved.

If you want this to apply ONLY to the TV you’ll have to replace the actual rule with a similar one that has an exception for the TV…

…or there’s probably another, more elegant way of doing it that one of the resident gurus will shortly chime in with. :wink:

EDIT - See? Even before I posted Draconis came to the rescue with a simple solution. That’s something I really like about I7, there’s so many different ways of achieving the same result.

Peter’s method is probably the better way in the long run. To supplement his answer, if you want to block the rule just for the TV, you could add something like this:

The examine devices rule does nothing when the noun is the TV.

(Note: this syntax only works in 6L02 onward; if you’re using 6G60 or earlier there’s a different way involving procedural rules but it’s more complicated.)

Thanks guys - much appreciated.

McT

I think the least-typing solution to this (though I haven’t tested it) is:

The examine devices rule does nothing when the noun is the television.

This is the substitute for the old procedural rules–I don’t know if it has performance issues that a modified rule wouldn’t have.

That’s a very cute syntax I knew not of. :slight_smile: Learned something already!