I7 compiler error 10

In my game, I have an NPC that can be knocked out; certain actions are allowable toward the NPC when the NPC is conscious, and certain actions are allowable when the NPC is unconscious. Along the way, though, I ran into a compiler error. I decided to try building a simple, stand-alone example to see if I could isolate the issue, and I’m running into the same problem.

The code for my stand-alone example is as follows:

A person can be conscious or unconscious. A person is usually conscious.

The Back Alley is a room. "This narrow alley between buildings is devoid of any features of interest. But it is a good place for a mugging. To the east lies an even narrower passage between brick walls." East of the Back Alley is the Dead End. The description of the Dead End is "The narrow passage ends here in a blank brick wall. There is no way to go but back west."

The innocent bystander is a man in the Back Alley. The description of the innocent bystander is "[if conscious]The man stands around with his hands in his pockets, minding his own business.[otherwise]The man lies on the ground, knocked out cold by your sucker punch.[end if]". Understand "man" as the innocent bystander.

Instead of asking the innocent bystander about something:
	say "The man starts when you address him. 'Oh, sorry. I wouldn't know much about that. He smiles sheepishly at you before going back to whistling and staring up into the night sky."
	
Instead of telling the innocent bystander about something:
	say "The man turns toward you as you begin to talk about [the topic understood]. He nods his head as you carry on, and when you finish he merely says 'Fascinating, indeed!' before turning away and intently examining his fingernails."

Instead of attacking the innocent bystander:
	now the innocent bystander is unconscious;
	now the innocent bystander is pushable between rooms;
	say "You quietly sidle behind the man and out of his view, and then you viciously punch him right behind the ear, knocking him to the ground."
	
Examining is possible interaction. Searching is possible interaction.

Before doing something other than possible interaction to the innocent bystander when the innocent bystander is unconscious:
	let the attempt be the action name part of the current action;
	say "(refusal to carry out [the attempt] on the unconscious man.)";
	stop the action.

When I try to compile this, though, I get this error:

I know that the problematic portion of the code is the last “before” rule–it is the same problem I was running into in my main game. Strangely enough, a wording like “Before doing something other than examining or searching to the innocent bystander when the innocent bystander is unconscious” works; it is only when I create another action and attempt to slot that into the rule that the compiler loses its mind. But I have to create an action, because one of the actions I want to allow is “pushing it to.”

Am I doing something wrong, and if so, what is it? (This seems to be an unusual circumstance, possibly requiring more information, so: I am running build 6M62 on Windows.)

Honestly, of all the things I was planning to implement in my game today, I did not foresee this being the thing that would stop me dead in me tracks. Hopefully one of the local gurus can solve this mystery; thanks in advance for any help!

I hardly qualify as a guru, I’m afraid, but the problem is the expression “possible interaction to the bystander”, which Inform is failing to deal with. Try this:

Before doing something other than possible interaction when the current action involves the innocent bystander and the innocent bystander is unconscious:

That does indeed work–thank you! So you are not allowed to create an action and then check for doing that new action to someone/something? Good thing to keep in mind.

You can’t specify the object for a kind of action like “possible interaction” with “to”. As seen in WI 7.15, you can completely specify an action (“kissing Mr Carr”) or describe a set of actions (“doing something to the painting”), but either way the resulting kind of action can’t be modified further when you use it as a condition for a rule. In your example you could use something like “Examining the innocent bystander is possible interaction”, although this isn’t any more convenient since “doing something other than possible interaction” then would apply to actions not involving the bystander at all (so you’d still have to put in another check for that).

Anyway, the compiler should issue a Problem message in this case rather than crashing. I will submit a bug report.

Thanks for the additional clarification. I was indeed aware of the ability to specify a very specific action (I’ve done that before), but I quickly realized that this was not going to be the best option, for the reasons you mentioned.

And thanks for submitting a bug report! I think if I had gotten a Problem message rather than a crash, I might have had more of a chance of figuring it out. It was a little unnerving, I must admit. I thought I had broken Inform.

You did break Inform. That’s why dfremont is filing a bug report. :slight_smile:

Oh, dear.

I can hear my mother saying, “This is why we can’t have nice things.”

To the contrary, bug reports are why nice things like I7 slowly keep getting nicer. You did good.

I was mostly being facetious, but thank you. It is good to know that my ignorance is of some use! :smiley:

I’ve run into this error too, whilst updating an old game, and I hoped the cause would be something like this. It would appear not. I have encountered the error previously with Inform 6 insertions, but this is not the cause on this occasion, either. There aren’t any. The game in question doesn’t use any extensions, either.

The only thing I can do is to systematically remove things from the game, in the hope of tracking it down, but before I do so, I wondered if there were any other known causes of error 10 that I should check first.

Currently probably the leading cause of internal errors is ending an “if” line with the wrong character:

[code]Lab is a room.

When play begins:
if 3 is 3;
say “Ooops.”[/code]

This gives a code 11 rather than a code 10, but it has on occasion resulted in a code 10.

Matt w, you nailed it. Thank you! :slight_smile: