I have a medicine cabinet that the player (in playtesting) is trying to push to open. It’s a legitimate action to attempt, as some medicine cabinets open this way. The problem is that I am getting the message:
It isn't something you can switch.
I have tried blocking the rules in this fashion, but it is not working:
the can't switch on unless switchable rule does nothing when pushing medicine cabinet;
the can't switch off unless switchable rule does nothing when pushing medicine cabinet;
instead of pushing medicine cabinet:
say "No, pushing the cabinet doesn't open it, either. Nice try, though.";
stop the action
Try typing RULES, then try pushing the cabinet again - some other rule in your code appears to be redirecting the push action to switching on or off, so that will help you find which one.
Inform really ought to be printing rule names, at least, that is the sum of my experience. I’m not sure what to make of that; I’m sure somebody will be able to help.
Do you have the line “Use memory economy” in your project? That’s usually what causes descriptive rule names to be replaced with meaningless memory addresses (among other effects).
go ahead and print the rules output, let’s see what you have.
re: Aaron’s response assistant is downloadable at the friends of inform github, that’s where most current (and most likely to be supported) versions of extensions are. help/hints might be there too, I’m not familiar.
Ok, here you go. I’m currently looking at the every turn rules it may be referencing to see if these may be causing the problem:
>rules
Rules tracing now switched on. Type "rules off" to switch it off again, or "rules all" to include even rules which do not apply.
[Rule "parse command rule" applies.]
>push medicine cabinet
[Rule "After reading a command" applies.]
[Rule "After deciding the scope of the player" applies.]
[Rule "declare everything initially unmentioned rule" applies.]
[Rule "generate action rule" applies.]
[Rule "announce items from multiple object lists rule" applies.]
[Rule "set pronouns from items from multiple object lists rule" applies.]
[Rule "before stage rule" applies.]
[Rule "Before doing anything other than guessing" applies.]
[Rule "basic visibility rule" applies.]
[Rule "basic accessibility rule" applies.]
[Rule "access through barriers rule" applies.]
[Rule "carrying requirements rule" applies.]
[Rule "instead stage rule" applies.]
[Rule "requested actions require persuasion rule" applies.]
[Rule "carry out requested actions rule" applies.]
[Rule "descend to specific action-processing rule" applies.]
[Rule "work out details of specific action rule" applies.]
[Rule "investigate player's awareness before action rule" applies.]
[Rule "player aware of his own actions rule" applies.]
[Rule "check stage rule" applies.]
[Rule "can't switch on what's already on rule" applies.]
[Rule "carry out stage rule" applies.]
[Rule "standard switching on rule" applies.]
*** Run-time problem P10: Since the medicine cabinet is not allowed the property "switched on", it is against the rules to try to use it.
[Rule "after stage rule" applies.]
[Rule "investigate player's awareness after action rule" applies.]
[Rule "report stage rule" applies.]
[Rule "last specific action-processing rule" applies.]
[Rule "A first turn sequence rule" applies.]
[Rule "scene change machinery rule" applies.]
[Rule "every turn stage rule" applies.]
[Rule "every turn when the player is in psychoffice" applies.]
[Rule "Every turn when fightmove is 0" applies.]
[Rule "Every turn when midget is active" applies.]
[Rule "After deciding the scope of the player" applies.]
[Rule "After deciding the scope of the player" applies.]
[Rule "every turn during solderingoff" applies.]
[Rule "every turn" applies.]
[Rule "every turn" applies.]
[Rule "every turn" applies.]
[Rule "After deciding the scope of the player" applies.]
[Rule "timed events rule" applies.]
[Rule "advance time rule" applies.]
[Rule "update chronological records rule" applies.]
[Rule "A last turn sequence rule" applies.]
[Rule "scene change machinery rule" applies.]
[Rule "adjust light rule" applies.]
[Rule "note object acquisitions rule" applies.]
[Rule "notify score changes rule" applies.]
[Rule "parse command rule" applies.]
To me, it reads that an instead rule is redirecting to switching on.
Your “rule does nothing” rule seems to be firing, since the runtime error is related to switching something that can’t be switched.
The problem is the redirect. Pushing action does not by default switch things on or off. I know this thread started re: blocking the rule, but that isn’t the way so far as I can see.
e: thinking further, I believe Mike’s thoughts on the “big” rules (after reading a command, before doing something, etc) are probably the best places to look.
It looks like you’ve got a custom after reading a command rule, after deciding the scope of the player rule, and a before doing anything other than guessing rule that might be the culprits - any of those look like they’re doing anything funky with redirecting actions to switching on/off?
Edit: and as Drew says it looks like you might have a general instead stage rule firing? I’m not sure how you could write one without a more descriptive header though.
Edit 2: comparing this output with a test of just pushing a cabinet in an otherwise-blank story, I’m starting to see deviations right after those two initial After rules. So I’d definitely look at those.