My brothers game has a problem...

Hi everybody,

Sorry that I’ve been asking a lot of questions, me and my brother are new to Inform 7. I think I got it, like, 5 days ago or something.

Anyways, my brother is making a text adventure, and he’s run into this problem:

[code]The corridor section is a room. [if we have not examined the corridor section]“After knocking out the thug you unlock the door and arrive in a corridor. The problem is, there is a conspicous layer of rust in your way, there are also some weird mossy unstable looking pillars.”.

The description is [otherwise]“The room is covered in moss and the pillars to the side look like they are ready to break.”.[/code]

The problem is that he wants to make it so that when you enter the room you would get:

After knocking out the thug you unlock the door and arrive in a corridor. The problem is, there is a conspicous layer of rust in your way, there are also some weird mossy unstable looking pillars.

And that when you examine the room, you would get:

The room is covered in moss and the pillars to the side look like they are ready to break.

However, when he runs the code, he gets this:

[code]This is the report produced by Inform 7 (build 6G60) on its most recent run through:

Problem. You wrote ‘“after knocking out the thug you un […] ird mossy unstable looking pillars”’ , but in another sentence ‘The description is “the room is covered in moss and th […] look like they are ready to break”’ : but this looks like a contradiction, because the same property seems to be being set in each of these sentences, but with a different outcome.
[/code]

Fix please?

The syntactical problem is that brackets outside strings are considered comments, so the compiler just ignores your conditionals and complains that you’re defining the room description twice. Bracketed conditions must be inside the entire description:

The corridor section is a room. "[if we have not examined the corridor section]After knocking out the thug you unlock the door and arrive in a corridor. The problem is, there is a conspicous layer of rust in your way, there are also some weird mossy unstable looking pillars.[otherwise]The room is covered in moss and the pillars to the side look like they are ready to break."
BUT it still won’t work, because you can’t examine rooms so “if we have not examined the corridor section” is always true. See this thread for alternate solutions.

Thank you! I will check out that thread.

IMHO the decision to use square brackets for comments, for conditions inside strings, and for tokens in Inform is a really Bad Idea. It makes these kinds of mistakes possible, since misplaced bracketed expressions are understood as comments by the compiler.

thx juhana that fixed it :smiley:, and peterorme thx for the warning, i wont use brackets so much. if ur wondering im superjax’s brother. also thx to the people who posted on that that thread juhana showed me and thx to the guy who made it :slight_smile: