intfiction.org

The Interactive Fiction Community Forum
It is currently Thu Oct 23, 2014 4:22 am

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: Sat Feb 25, 2012 5:28 am 
Offline

Joined: Thu Feb 23, 2012 2:23 pm
Posts: 21
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.".


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

Code:
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:

Code:
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.


Fix please?


Top
 Profile Send private message  
 
PostPosted: Sat Feb 25, 2012 8:09 am 
Offline

Joined: Tue Dec 25, 2007 10:06 am
Posts: 1197
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:

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

_________________
Vorple UI libraryBeta testing siteBlog


Top
 Profile Send private message  
 
PostPosted: Sat Feb 25, 2012 8:26 am 
Offline

Joined: Thu Feb 23, 2012 2:23 pm
Posts: 21
Thank you! I will check out that thread.


Top
 Profile Send private message  
 
PostPosted: Sat Feb 25, 2012 11:21 am 
Offline
User avatar

Joined: Wed Nov 30, 2011 2:43 am
Posts: 331
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.

_________________
WIP: The Night Shift (game), Checkpoints (I7 extension)


Top
 Profile Send private message  
 
PostPosted: Sat Feb 25, 2012 12:19 pm 
Offline

Joined: Sat Feb 25, 2012 12:03 pm
Posts: 4
thx juhana that fixed it :D, 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 :)


Top
 Profile Send private message  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: Eleas and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group