Mr. Pinhead (me) has another question

Still working through Aaron Reed’s Sand-dancer tutorial, run into another snag I hope someone can explain.

Here are some relevant pieces of source code:

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.

and

Instead of throwing something (called the missile) at a closed window (called the targeted window):
now the missile is in the other side of the targeted window;
now the targeted window is open;
say “[The missile] smashes through [the targeted window], shattering it.”

The deal is, the program doesn’t recognize the window, and I can’t figure out why not. Any help will be appreciated.

Ok. First, have you defined the window kind (as in, “A window is a kind of thing.” or “A window is a kind of door.”)? Without telling the compiler what a window is, Inform won’t understand what you mean.

Yes. Here’s that code;

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.”

Could you show us the error you got? Does the code not compile, not work, or what?

Also, for code, please put it inside [code]

[/code] tags. Otherwise we’ll have no idea whether your indentation is correct.

Here is the error message:

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

Problem. The phrase or rule definition ‘Instead of throwing something (called the missile) at a closed window (called the targeted window)’ is written using the ‘colon and indentation’ syntax for its 'if’s, 'repeat’s and 'while’s, where blocks of phrases grouped together are indented one tab step inward from the ‘if …:’ or similar phrase to which they belong. But the phrase ‘if other side of targeted window is Staging Area’ , which ought to begin a block, is immediately followed by ‘now missile is undescribed’ at the same or a lower indentation, so the block seems to be empty - this must mean there has been a mistake in indenting the phrases.


Problem. The phrase or rule definition ‘Instead of throwing something (called the missile) at a closed window (called the targeted window)’ is written using the ‘colon and indentation’ syntax for its 'if’s, 'repeat’s and 'while’s, where blocks of phrases grouped together are indented one tab step inward from the ‘if …:’ or similar phrase to which they belong. But the tabs here seem to be misaligned, and I can’t determine the structure. The first phrase going awry in the definition seems to be ‘now missile is in the other side of the targeted window’ , in case that helps.

This sometimes happens even when the code looks about right, to the eye, if rows of spaces have been used to indent phrases instead of tabs.

That seems pretty straightforward - the code generating the error isn’t indented correctly. E.g., instead of doing this,

Instead of throwing something (called the missile) at a closed window (called the targeted window): now the missile is in the other side of the targeted window; now the targeted window is open; say "[The missile] smashes through [the targeted window], shattering it."do this:

Instead of throwing something (called the missile) at a closed window (called the targeted window): now the missile is in the other side of the targeted window; now the targeted window is open; say "[The missile] smashes through [the targeted window], shattering it."

Thanks! Told you I was a pinhead! Still am!