intfiction.org

The Interactive Fiction Community Forum
It is currently Fri May 24, 2013 6:35 am

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Tue Dec 06, 2011 2:59 am 
Offline

Joined: Wed Oct 13, 2010 1:42 am
Posts: 343
Why do the first and third of the following conditions work, but not the second? That is, why can you write a condition about an object on a supporter (or in a container) or a person in a room, but not, apparently, about a person on a supporter?

Code:
The park is a room.

The bench is an enterable supporter in the park.

Every turn:
   if something is on the bench:
      say "Something is on the bench.";
   if someone is on the bench:
      say "Someone is on the bench.";
   if someone is in the park:
      say "Someone is in the park."
      
Alice is on the bench.


Top
 Profile Send private message  
 
PostPosted: Tue Dec 06, 2011 3:16 am 
Offline
User avatar

Joined: Thu Nov 04, 2010 6:30 am
Posts: 986
Location: Gothenburg, Sweden
You haven't told the game that Alice is a person, so it believes she's a thing. Therefore the first condition is met, but not the second. The third condition is met, not because Alice is in the park, but because the player is.

Also, "in the park" means directly in the room, withou being in or on anything else. If you want the game to recognize that Alice is in the park even though she's also on the bench, you need to write "if someone is enclosed by the park".

_________________
Man ska inte tro allt man tänker.


Top
 Profile Send private message  
 
PostPosted: Tue Dec 06, 2011 10:45 am 
Offline

Joined: Fri Jul 16, 2010 2:09 pm
Posts: 1950
To debug a situation like this, you can use naming or list-printing:

Code:
Every turn:
   if something (called the item) is on the bench:
      say "[The item] is on the bench.";
   if someone (called the sitter) is on the bench:
      say "[The sitter] is on the bench.";
   if someone (called the visitor) is in the park:
      say "[The visitor] is in the park."


or:

Code:
When play begins:
   showme the list of things on the bench;
   showme the list of people on the bench;
   showme the list of people in the park;


Top
 Profile Send private message  
 
PostPosted: Tue Dec 06, 2011 9:39 pm 
Offline

Joined: Wed Oct 13, 2010 1:42 am
Posts: 343
...Dammit, that's what I get for trying to error trap late at night. I did have a real problem and I'll post it as soon as I can actually replicate it.

EDIT: Never mind, found it. It did behave strikingly like the above, but for different reasons.


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

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: Google Feedfetcher and 2 guests


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