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!