Variable unavailable for this action, activity, or rulebook

Argh. I’m getting the run-time error message, “Variable unavailable for this action, activity, or rulebook: internal ID number 20009/0.”

I understand that this error, or a variation of it, can occur when you try to declare an action variable that’s already being used by another action. However I’m not sure if that’s what’s happening here. I don’t have any actions with action variables in my WIP. What’s more, the error message occurs at the end of every turn, no matter what action the player actually performs. I’ve tried commenting out different rulebooks from the action-processing and turn-processing rules, but can’t seem to narrow it down.

There once was a way to access the I6 code that Inform generated from the story.ni file, wasn’t there? I can’t seem to find the I6 code anywhere now. I was hoping that if I could look at the I6 code, I might be able to track down where this error is coming from with the internal ID number.

Any suggestions? I’m just about at the headbanging stage.

At least on Windows, the generated Inform 6 source is in “Build/auto.inf” in the project directory. It’s deleted by default when the project is closed, though, unless this is disabled from the preferences.

That did the trick! Thank you.

Important safety tip: don’t use action variables in conditions involving the past tense.

Could you give an example of this, so I know how to avoid it?

After exiting: if Batman was in the container exited from, say "As soon as Batman gets out of [the container exited from], you scramble out after him."

“The container exited from” is an action variable for the exit action. Using it in the past tense like that (“if Batman was in the container exited from”) will cause problems, but the compiler won’t stop you from doing it, and the run-time error message you do get is maddeningly vague.

(The compiler SHOULD catch it, because you’re not supposed to use temporary variables of any kind in the past tense. I’ve already reported the problem as a bug.)

I see. Thanks, Michael. :slight_smile: