[I7] printed status of devices

When a device is examined it reports that the device is switched either on or off. Is there a way to omit the printing of the on/off state of the device?

There are a few things you can do here.

One is just to make a new kind instead of devices. Devices are pretty simple, really; they only do two things (being switchable on and off, and reporting the state of the switch when they’re examined.)

The other approach is to work out which rule makes them report their switched status; looking in the Standard Rules, turns out it’s the examine devices rule. So all you need to do is copy the code, edit out the bits you don’t want, and make it into a new rule that replaces the original one:

[code]Carry out examining (this is the replacement examine devices rule):
if the noun is a device:
[issue library message examining action number 3 for the noun;]
now examine text printed is true.

The replacement examine devices rule is listed instead of the examine devices rule in the carry out examining rules.[/code]
If you want it to behave normally for most devices but stop working for specific ones, you could put an if argument in there instead.

Awesome, that worked like a charm. Thank you! Very cool.

I had a feeling (in my many hours of trying to figure this out) that finding and changing the standard was the answer, at least I guess one of them. I looked for the rule but I couldn’t find anything that seemed like it might be the one. Maybe I wasn’t thinking it was an examine rule, more a device rule or something. Either way, I would have had NO idea to change it like that. I have a ton of learning to do.
Thank you so much, maga.

May I ask for one more bit of help?

My device is something that I’ve given to an antagonist in my story. I’ve written the device as a weapon (Si-fi story) that needs to be switched on and off. When the story is played the player is allowed to switch off the device, even though it’s not in the possession of the player. I have no idea why. Is this normal device behavior? Maybe I’m going about this the wrong way? Am I creating a device where no device is needed?

A good way to find out what rules are responsible for this or that response to a command (while testing your game in the Inform IDE application) is to use the debug command RULES. Type that command, and in the following turns the game will list the name of every rule it checks in the course of processing a player’s command. The rule named just before some text output from the game is very likely to be the rule you have to meddle with to change the output. (To turn off this debugging functionality, enter the command RULES OFF.)

(The command ACTIONS functions similarly.)

The Standard Rules allows the player to switch things on and off without holding them.

You have to add a rule of your own to check that behavior:

Before switching on something:
if the player is not holding the noun:
say “(first taking [the noun])”;
silently try taking the noun;
if the player is not holding the noun:
stop the action.

Before switching off something:
if the player is not holding the noun:
say “(first taking [the noun])”;
silently try taking the noun;
if the player is not holding the noun:
stop the action.

Deleted an irrelevant line that unlisted the block giving rule and that I only used for testing purposes.]
[/code](You have to check a second time whether the player is holding the noun, since you don’t know beforehand whether he/she will succeed in taking it.)

Or if you want this to apply only to a single device, instead write:

Before switching on the disruptor: [etc.]

This could be dangerous since this will give a blank response when examining a device that doesn’t have a description. It would be much better to unlist the rule altogether, like so.

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

Hope this helps.

Felix, This is so great, what a powerful tool. Thanks for showing me this I really appreciate it! Also I used your code so that the player won’t be able to switch off anything he’s not holding… Thanks, worked perfect.

Climbingstars, thanks for the heads-up, I could see how it could possibly be dangerous down the road. I was expecting the solution to this problem would in fact be to unlist a rule. I just wasn’t sure which one it was and if I unlisted it… would it change devices so much producing and undesirable effect?

I think Maga meant to say that with this?

I believe Maga was considering case where you would only want the on off message for devices stopped for some devices and not all of them. The best way to do that would be like this.

[code]Carry out examining (this is the new examine devices rule): unless the noun is (whatever), anonymously abide by the examine devices rule.

The new examine devices rule is listed instead of the examine devices rule in the carry out examining rulebook.[/code]

Here, you can use either a thing or a kind of thing for “whatever”.

That said, if you want to remove the message for all devices, it’s better to unlist the relevant rule.

Unlisting that rule will just remove the message, so it shouldn’t have any side effects. In fact, the standard rules are designed to make it easy to remove individual bits just by unlisting the relevant rules.

Hope this helps.

Thanks, climbingstars, it very much does. It’s great for me to see this problem and solution from all sides, I think, to (hopefully) better understand how it works.

Thanks to everyone, it’s all really invaluable!