intfiction.org

The Interactive Fiction Community Forum
It is currently Mon Oct 22, 2018 7:04 pm

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Mon Aug 06, 2018 3:11 pm 
Offline

Joined: Sat Jun 09, 2018 8:42 am
Posts: 16
With this sample code:

Code:
The Lounge is a room.
Some Stairs are in the Lounge.

Rule for supplying a missing noun while climbing:
   now the noun is the Stairs.

Instead of climbing the stairs, say "YAY!"

The player holds a hat.


I'd expect plain "CLIMB" to climb the stairs, but instead:

Code:
>rules
Rules tracing now switched on. Type "rules off" to switch it off again, or "rules all" to include even rules which do not apply.

>climb
(the hat)
[Rule "declare everything initially unmentioned rule" applies.
....


e.g. the hat is chosen, which is silly, and seems to be chosen before any rules run, so doesn't let me overrule the silliness.
How does the missing noun get supplied?

Looking in the rules index, there are only missing noun rules for smelling, listening, entering, and going, so presumably this is a completely different mechanism?

_________________
osf'


Top
 Profile Send private message  
Reply with quote  
PostPosted: Mon Aug 06, 2018 3:36 pm 
Offline

Joined: Tue Mar 09, 2010 2:34 pm
Posts: 5386
Location: Burlington, VT
The supplying a missing noun activity only runs if there's a nounless Understand line, so you also need:

Code:
Understand "climb" as climbing.



...and yes, the thing that selects the hat is a different mechanism, which is buried deep within the parser and hard to change. The "clarifying the parser's choice of something" activity is what prints "(the hat)" once that has happened, but you can't really use that to fix it, I don't think.


Top
 Profile Send private message  
Reply with quote  
PostPosted: Mon Aug 06, 2018 3:47 pm 
Offline

Joined: Mon Dec 15, 2014 9:15 am
Posts: 347
You can nudge the parser towards a sensible decision with
Code:
Does the player mean climbing the stairs: it is likely.


Top
 Profile Send private message  
Reply with quote  
PostPosted: Tue Aug 07, 2018 4:50 am 
Offline

Joined: Sat Jun 09, 2018 8:42 am
Posts: 16
Ah, thanks both! Both very helpful suggestions (I'd arrived at the "Understand" line but only by trial-and-error, it's good to have confirmation that it's a sensible thing to do and not just a coincidence!)

_________________
osf'


Top
 Profile Send private message  
Reply with quote  
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: No registered users and 8 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