Noobie with False Exit problem

I’m trying to write a section of hotel hallway that is lined with a mix of accessible and inaccessible doors, and would like to have specific responses to trying to go through the false exits. While I know I can do this with a whole bunch of new After rules, having a single rule to do it seems like a more elegant solution and I think I’ve nearly got it by having the rule consult a table…

[code]After going a direction (called the walked direction) in the Fourth Floor:
If the walked direction is a path listed in the Table of Hallway Doors:
Say “Foo!”.

Table of the Hallway Doors
Path Room
“northwest” “401”
“southwest” “412”[/code]

But Inform isn’t recognizing the second line: If the walked direction is a path listed in the Table of Hallway Doors. And I’ve no idea why :confused:. It was complaining that the values didn’t match as well, but now it’s just not recognizing the phrase at all.

Try taking off the quotation marks in the table (at least in the Path column). Northwest, southwest, and other directions are actually objects in the game code and so they don’t need to be put in quotation marks. (For the same reason that if you want to use a number in the game code you write 2 rather than “2”.) So the game thinks your table is full of quoted text strings and doesn’t recognize them as directions. If you take those quotation marks away it should recognize them as directions.

Also right now you have “Table of Hallway Doors” and “Table of the Hallway Doors”; that might explain your second problem.

Aha! Now it’s working perfectly, thank you!

Well, d’oh. I’m still underestimating the power of one wrong word to gum up the works…

When the rubber hits the road, I7 is still a computer programming language. In many of the languages related to C, you can bring your program to its knees by carelessly typing = when you mean ==. It will compile, but it won’t do what you’re expecting it to do.

I7’s “natural language” programming syntax sort of invites linguistic confusion, unfortunately. Many phrase constructions that a native speaker of English would regard as equivalent will baffle the compiler.

To be sure, as a TADS user I have a partisan view of this issue, but as a regular lurker on the Inform forum, I don’t think I’m misrepresenting the situation.

I don’t think it counts as lurking.

Well, it’s mostly lurking. I read the new messages every day. I rarely comment.