intfiction.org

The Interactive Fiction Community Forum
It is currently Sun May 19, 2013 8:35 am

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 11 posts ]  Go to page 1, 2  Next
Author Message
PostPosted: Mon May 28, 2012 12:45 pm 
Offline
User avatar

Joined: Mon Oct 03, 2011 12:03 pm
Posts: 632
Location: Stoke Barehills
I'm probably being dense here, but let's say I have this situation:

Code:
The cellar is a dark room.

Every turn when the player is in the cellar:
say "There's a faint whimper coming from one corner."

The whimper is in the cellar. Understand "corner" and "sound" as whimper.

Instead of listening to the whimper:
say "That must be where Fido has been hiding!"


Where the result is:

Quote:
It is pitch darkness, and you can't see anything.

There's a faint whimper coming from one corner.

> listen to whimper

You can't see any such thing.


As if listening required line of sight! I can think of a few laborious ways of getting this to behave, but what's the most straightforward?


Top
 Profile Send private message  
 
PostPosted: Mon May 28, 2012 12:58 pm 
Offline

Joined: Wed Feb 29, 2012 2:00 pm
Posts: 672
This is probably the most straightforward way.

Code:
"Test"

After deciding the scope of the player:
if the player is in the dark cellar, place the whimper in scope.

The cellar is a dark room.

Every turn when the player is in the cellar:
say "There's a faint whimper coming from one corner.".

The whimper is in the cellar. Understand "corner" and "sound" as whimper.

Instead of listening to the whimper:
say "That must be where Fido has been hiding!".

Test me with "l / listen to whimper".


It's pretty much all scopy stuff. You can see something similar here.

Hope this helps.

_________________
"Will you stop breaking the fourth wall? It's costing me an absolute fortune to replace it!"


Top
 Profile Send private message  
 
PostPosted: Mon May 28, 2012 1:36 pm 
Offline
User avatar

Joined: Mon Oct 03, 2011 12:03 pm
Posts: 632
Location: Stoke Barehills
Aye, I thought a scope rule would be the key. As it stands, the code you've given me is way too broad as it would allow me to take the whimper! However, this line fixes matters:

Code:
Instead of doing anything other than listening when the noun is the whimper:
say "You can only listen to the whimper."


Top
 Profile Send private message  
 
PostPosted: Mon May 28, 2012 7:38 pm 
Offline

Joined: Tue Mar 09, 2010 2:34 pm
Posts: 2127
Location: Burlington, VT
You'll want "or the second noun is the whimper" too, or you'll get the wrong error messages when you try to put things in the whimper.


Top
 Profile Send private message  
 
PostPosted: Mon May 28, 2012 10:26 pm 
Offline
User avatar

Joined: Mon Oct 03, 2011 12:03 pm
Posts: 632
Location: Stoke Barehills
Ah, good shout. I'd forgotten about that!


Top
 Profile Send private message  
 
PostPosted: Tue May 29, 2012 5:39 am 
Offline
User avatar

Joined: Sun Nov 22, 2009 12:58 pm
Posts: 399
Location: Malmö, Sweden
matt w wrote:
You'll want "or the second noun is the whimper" too, or you'll get the wrong error messages when you try to put things in the whimper.


Or you use this

Code:
To decide whether any/either/a noun is (item - a thing) (this is the match either noun rule):
   if item is the noun, decide yes;
   if item is the second noun, decide yes;
   decide no.


to write

Code:
Instead of doing anything other than listening when either noun is the whimper:
say "You can only listen to the whimper."


which feels more I7 somehow.

_________________
~Björn Paulsen


Top
 Profile Send private message  
 
PostPosted: Tue May 29, 2012 6:03 am 
Offline
User avatar

Joined: Wed Oct 14, 2009 4:02 am
Posts: 963
No need for that:

Code:
Instead of doing anything other than listening when the current action involves the whimper:
    say "You can only listen to the whimper."


See 12.20


Top
 Profile Send private message  
 
PostPosted: Wed May 30, 2012 6:14 am 
Offline
User avatar

Joined: Sun Nov 22, 2009 12:58 pm
Posts: 399
Location: Malmö, Sweden
Dannii wrote:
No need for that:

Code:
Instead of doing anything other than listening when the current action involves the whimper:
    say "You can only listen to the whimper."


See 12.20


True. It works, but I never liked it as a solution. When the common solution for matching noun or second noun to a given item is to use objects that vary, then logically matching both at the same time should use the same syntax, not a completely different one using a completely different mechanism. IMHO, of course.

So I guess what I'm trying to say is, it feels wrong on a conceptual level as opposed to a functional one.

_________________
~Björn Paulsen


Top
 Profile Send private message  
 
PostPosted: Wed May 30, 2012 7:24 am 
Offline
User avatar

Joined: Wed Oct 14, 2009 4:02 am
Posts: 963
I don't understand why you think that. It's really almost equivalent to your phrase, except that it also checks the actor. (Actually it also uses block values so it might be considerably slower... I don't think the current action variable is normally set so this will add extra processing.)

Also, To...: are phrases, not rules. So you should say

To decide whether any/either/a noun is (item - a thing) (this is the match either noun phrase):


Top
 Profile Send private message  
 
PostPosted: Thu May 31, 2012 4:38 am 
Offline
User avatar

Joined: Sun Nov 22, 2009 12:58 pm
Posts: 399
Location: Malmö, Sweden
Dannii wrote:
I don't understand why you think that. It's really almost equivalent to your phrase, except that it also checks the actor. (Actually it also uses block values so it might be considerably slower... I don't think the current action variable is normally set so this will add extra processing.)

A caveat: I'm obviously not at your level when it comes to programming. That said, my reasoning was this:

  • To see if X is the noun, we use a "to decide" phrase on an object that varies.
  • To see if X is the second noun, we use a "to decide" phrase on another object that varies.
  • To see if X is either of them noun, we use a "to decide" phrase on a stored action.

Conceptually, the third seems a different way of doing it for no apparent reason.

Dannii wrote:
Also, To...: are phrases, not rules. So you should say

To decide whether any/either/a noun is (item - a thing) (this is the match either noun phrase):

I didn't even know that was accepted syntax. Huh.

_________________
~Björn Paulsen


Top
 Profile Send private message  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 11 posts ]  Go to page 1, 2  Next

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: Bing [Bot], Google [Bot] 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