I was trying to make a complicated horror project and immedietly encountered a problem;
I put in
Top Floor of Mansion is a room. There is a button 1 here. There is a button 2 here. There is a button 3 here.
and thought it would work. It did, but this is what it says when i test it:[code]Top Floor of Mansion
The syntax for that is “Button 1 is here.” The original code creates off-stage objects called “button 1 here,” “button 2 here,” and “button 3 here” – “here” is parsed as part of the object name. I usually find it less confusing to write out the name of the room anyway (as you did).
“Top Floor of Mansion” and “Top Floor of the Mansion” are considered two different things. (“the” doesn’t usually make a difference, but only when it’s at the start of a name.) You’re creating an off-stage container called “top floor of the mansion” where the buttons are.
If you open the World tab in the index, you can see the rooms and things created in the game world. You can check for duplicates and misspellings there.
This is a bit counter-intuitive, but it works like this: some rulebooks (Before, Instead and After) allow a comma between the preamble and the body of the rule, but only if the rule consists of one statement. In other cases you use the semicolon to separate the statements, like so:
Instead of pressing the red button:
say "A giant mutant ant eats you.";
end the game in failure.
Generally, rulebooks are written on that form, i.e. either
Instead of pressing red button, say "A giant mutant ant eats you." End the game in failure.
These are two instructions, yet between the preamble and the rules body you have a comma, so Inform thinks the rules body consists of one statement (and say “A giant mutant ant eats you.” End the game in failure. makes two statements). Furthermore, you do not separate these two statements with a semi-colon, therefore only the first statement is parsed as part of the Instead rule, and the second is read by Inform as being outside that rule.
Besides what Eleas said, “End the game in failure” isn’t recognized, I don’t think. You probably want “End the game in death.” This phrasing is now deprecated (meaning it still works but it probably won’t in future builds); see section 9.4 which explains your options. If you want a new-fangled way of ending the game in death, it’s
I totally forgot about it being deprecated. Given that and me looking at “button 1 is here” without seeing the problem, I’ve overlooked things twice in this thread, gah. Time for me to finally get my arse in gear and write an IF, or I’ll keep making sloppy mistakes.