Possible I7 error in complex directions.

Now, I know that somebody will find fault in my not providing all the code surrounding this problem, but let’s try it this way first:

In the following code segment:

If I remove the line with the text Ouch, Ouch, control should be transfered to the southeast which sould be an adjoining room (D62875) but it is, if effect, transfured to:

which is a bit peculiar because they are in different regions (HRoom for the FryingpPan and UCaverns for the source of the action).

I can correct this problem by adding the italicised line but it seems to pop up in several other places.

Any thoughts will be appreciated.

Greg

I’m not really sure what the question is, but when you write a rule like “Instead of going southeast: …” it applies at any time the player tries to go southeast, unless some more specific rule applies. So normally when you try to go southeast from room C52875 the “Instead of going southeast from C52875: …” rule applies, but if you remove that rule the more general “Instead of going southeast” rule applies. The rules aren’t automatically tied to the rooms that are defined near them.

Does this answer your question?

Actually, I was just going to point out that you posted this in the wrong sub - forum. :wink: As far as the code, what you posted is both compilable (well, once I took out the reference to custom styles) and sufficiently illustrates the problem, so kudos there.

(Juhana beat me to it but…) The issue is in Section 4 - Giant Frying Pan, and I can see why it pops up quite often – you forgot to put a condition on the instead rule which ends the game. It will fire any time the player tries to go southeast from anywhere (as long as another rule hasn’t intervened first). Try changing it to:Instead of going southeast in Giant Frying Pan: say "Blah, blah..."; end the game in death.

instead of going southeast in giant frying pan:

After reading your answers and tearing my code apart, I finally realized that what was missing was the segment in giant frying pan.

I guess I keep forgetting one very critical fact about writing in Inform. The operative term here is writing, not programming. As you well know, a missing term or misspelled word in a compiler such as Basic or FORTRAN can lead to an error message. In Inform it will either be ignored, misdirected or worse, assumed to be a new command of some form.

Chalk it up to another lesson noted on the freeform blackboard. I am learning to like Stewed Crow.

Greg :smiling_imp:

Well, what you ran into is not a distinctive feature of I7. “Instead of ACTION: …” is a valid syntax that you will frequently use. “Instead of ACTION CONDITION:…” is another. Use the wrong one, you get the wrong result.

This has parallels in most programming languages. (E.g. Perl: “die” vs “die if $_”.)