Sand-dancer

I am working through Aaron Reed’s book “Creating Interactive Fiction with Inform 7” and have hit a wall with the section of code on page 181. There are two versions of the same code on this page, and neither of them will run. Has anyone else found this problem, and solved it? Thanks for any help. Mike

What release of Inform are you using? I don’t have this book (yet ^^), but I remember that a lot of plugins broke with 6L02 and newer due to the syntax changes.

Try 6G60 instead.

inform7.com/download/release/6G60/

Thank you for your reply. I have switched to the earlier version but unfortunately the problem persists

It would help if you described a bit more what kind of problem you’re having (the error message at least). And you improve your chances of getting help if you copy-paste the code that doesn’t work here for people who don’t have the book handy.

He’s talking about this:

[code]Let’s start with the rule that creates the central action of the puzzle. In Chapter - Office
Interior, make a new heading called Section - Windows. Move the existing lines of window
code inside, and then add this at the bottom:
Instead of throwing something at a window:
let missile be the noun;
let broken window be the second noun;
move missile to location;
now broken window is open;
say “[The missile] smashes against [the broken window], shattering it.”

(…)

Since nouns and second nouns are often referred to within action rules and phrases, you can
use the special word called within the rule definition to quickly create local variables to hold
these values. This is exactly equivalent to the rule above:

Instead of throwing something (called the missile) at a window (called the
broken window):
move missile to location;
now broken window is open;
say “[The missile] smashes against [the broken window], shattering it.”[/code]

I figured it was faster than waiting for the OP. In future, please give more information about the code you are using, not everyone has this book. Now: exactly what problem are you experiencing? The code seems valid enough as it stands (say the guy who hasn’t actually coded anything in years), though you do have to watch for indentation and, obviously, create a window which is openable. I don’t remember whether “move” was deprecated, too.

Thanks for the help. The section of code I have trouble with is:

Section - Windows

A window is a kind of door. A window is usually closed, unopenable and undescribed. Understand “window” as a window. The description of a window is usually “[if noun is open]Just an empty frame. [otherwise]Dusty glass panes.”

A pane of cracked glass is a window. It is outside of Staging Area and inside from Crumbling Concrete. A dust-covered window is a window. It is outside of Foreman’s Office and inside from Base of the Tower. A tiny frosted window is a window. It is outside of Break Room and inside from Weed-strewn Rust.

Understand the open property as describing a window.

Instead of opening or closing a window: say “[if noun is open]It’s already busted open.[otherwise]It looks like these windows have been rusted shut for years.”

Instead of throwing something at a window:

*  let missile be the noun;

*  let broken window be the second noun;

*  move missile to location;

*  now broken window is open;

*  say "[The missile] smashes against [the broken window], shattering it."

and the error messages are:

(Each time Go or Replay is clicked, Inform tries to translate the source text into a working story, and updates this report.)

In Part - Setting, Chapter - Office Interior, Section - Windows:

Problem. You wrote ‘Instead of throwing something at a window’ : but I can’t find a verb that I know how to deal with, so can’t do anything with this sentence. It looks as if it might be a rule definition, but if so then it is lacking the necessary colon (or comma). The punctuation style for rules is ‘Rule conditions: do this; do that; do some more.’ Perhaps you used a full stop instead of the colon?

See the manual: 19.3 > 19.3. New rules


Problem. In the sentence ‘let missile be the noun’ , I can’t find a verb that I know how to deal with.

See the manual: 2.1 > 2.1. Creating the world


Problem. In the sentence ‘let broken window be the second noun’ , I can’t find a verb that I know how to deal with.


Problem. In the sentence ‘move missile to location’ , I can’t find a verb that I know how to deal with.


Problem. In the sentence ‘say “[The missile] smashes against [the broken window], shattering it.”’ , I can’t find a verb that I know how to deal with.

Problems occurring in translation prevented the game from being properly created. (Correct the source text to remove these problems and click on Go once again.)

I hope this is enough to enable someone to define the root of the problem. Thank you. Mike

Edit - The lines shown with an asterisk are indented in the original

It looks as if you have extra line breaks between the lines in that paragraph, maybe? Try doing it again with no white space between the paragraphs, which should look like this (turning the asterisks back into tabs):

[code]Instead of throwing something at a window:

  • let missile be the noun;
  • let broken window be the second noun;
  • move missile to location;
  • now broken window is open;
  • say “[The missile] smashes against [the broken window], shattering it.”[/code]

That is to say, it should look exactly the way “” formatted it above; if you just copy-paste the part of his post that contains that code into Inform where you have your rule now, it should compile.

Paragraphing is very important in Inform 7 source code; if there’s a line of white space between two lines, Inform 7 treats them as separate blocks of code. In this case it needs to know that all the indented lines are part of the “Instead of throwing something at a window” rule, and the whitespace prevents that from happening.

(In general “I can’t find a verb that I know how to deal with” is an error that often happens when something’s standing on its own and needs to be part of a rule declaration, for instance if you put an “if” statement on its own.)

Thank you for that. I took out the blank lines, and that section of code was accepted. However, I now have another problem. The error report is telling me that in a section labelled Control Centre there is problem concerning a dusty window, but there is no window in Control Centre, as shown in the code below:

Section - Control Centre

A can opener is in Control Center. The can opener is privately-named. Understand “opener” or “can opener” as the can opener. The initial appearance of can opener is “Hey, on one pile is a perfectly good can opener.”

The description of Control Centre is “Some kind of electrical control stuff must have happened here once, but it’s totally trashed now. Like, [piles of trash], broken equipment, and junk are everywhere. Back down is the only place to go.”

Some piles of trash are scenery in Control Centre. Understand “broken/equipment/junk” as piles of trash.

The smell of gasoline is fixed in place in Control Centre. “[if player holds scent]You can clearly smell gasoline coming from under that [sheet of corrugated metal][otherwise]You catch a faint whiff of gasoline coming from somewhere[end if].” Understand “faint/whiff” as smell of gasoline. Understand “gas” as smell of gasoline when gas can is not visible.

Instead of doing anything to smell of gasoline, say “[if player holds scent]It’s coming from beneath that [sheet of corrugated metal][else]You can’t tell where the smell is coming from[end if].”

Instead of smelling Control Centre, try smelling smell of gasoline.

A sheet of corrugated metal is an undescribed fixed in place thing in Control Centre.

Instead of searching or taking piles of trash: try looking under piles of trash. Instead of searching or taking or looking under sheet of corrugated metal: try looking under piles of trash. Instead of looking under piles of trash: say “You root around in the trash hopelessly, but there’s a lot of it. You don’t turn up anything useful.”

Instead of looking under piles of trash when player holds scent: say “Your sense of smell leads you straight to a [sheet of corrugated metal]. You lift it [if player holds strength]effortlessly [end if]and throw it aside, revealing a gas can.”; move gas can to location; now smell of gasoline is off-stage.

A gas can is a closed openable container. The description is “It’s full of gas.” Instead of opening gas can: say “You don’t want to spill it.”

The error report is:

(Each time Go or Replay is clicked, Inform tries to translate the source text into a working story, and updates this report.)

In Part - Setting, Chapter - Office Interior, Section - Control Centre:

Problem. The dust covered window seems to be a door with no way in or out, so either you didn’t mean it to be a door or you haven’t specified what’s on each side. You could do this by writing something like ‘The blue door is east of the Library and west of the Conservatory’.

See the manual: 3.12 > 3.12. Doors

Any help will be greatly appreciated. Mike

That sounds weird. Have you looked in the index (in Inform) for “dust covered window”?

It is weird. The index is empty until the programme runs, and as it won’t run there’s no index!!

Ctrl-F and search for “dust covered window” in the source code.

Thank you. I used Ctrl + F and found an entry which I amended and that solved the problem. Thanks for all the help. Mike

Try going to the source and searching (control F) for “dust covered window” and see how many times it appears. It might have gotten stuck into the wrong place, or perhaps mentioned before it was actually created. Or even weirder, maybe some other object at some point is given the printed name “dust covered window”.

I remember one annoying object in Transparent that I had somehow given the printed name of “” and it kept showing up during play randomly but since it had no actual name I couldn’t figure out what or where it was!!

Thank you HanonO. I will try that and see where it goes. Mike