intfiction.org

The Interactive Fiction Community Forum
It is currently Sun Oct 22, 2017 5:35 pm

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 22 posts ]  Go to page 1, 2, 3  Next
Author Message
PostPosted: Thu Nov 19, 2015 9:00 am 
Offline
User avatar

Joined: Sun Nov 22, 2009 12:58 pm
Posts: 706
Location: Malmö, Sweden
Code:
A sword is a kind of thing.

Understand "blade/edge/sword" as "[blade]".
Understand "[blade]" as sword.

Definition: a thing is perfect if it is nowhere.
Understand the command "ask" as something new.
Quizzing it about is an action applying to one thing and one visible thing. Understand "ask [someone] about [any thing]" as quizzing it about.

Does the player mean quizzing about a perfect thing: it is very likely.


The swordsmith is a man. Understand "smith" as the swordsmith.

The ideal sword is a sword.
Understand "blades/edges/swords" as the ideal sword.

The rakish fop is a man. The fop holds a sword called the wicked needle.
The dolorous monk is a man. The monk carries a sword called the keen instrument of DEATH.

After quizzing the swordsmith about the ideal sword, say "Yes, swords are the best!"
After quizzing the swordsmith about a sword (called blade), say "Hmm, [the blade]... not my best work, to be honest."

The forge is a room. All men are here. The player is the monk.

Test me with "ask smith about sword/ask smith about my sword/ask smith about instrument/ask smith about swords".


Result is the "You can't use multiple objects with that verb." error message.

I'd love to be able to ask about things in the general plural, but so far I've been frustrated. Does anyone have an idea of how to handle this issue gracefully?

_________________
~Björn Paulsen


Last edited by Eleas on Thu Nov 19, 2015 9:33 am, edited 1 time in total.

Top
 Profile Send private message  
Reply with quote  
PostPosted: Thu Nov 19, 2015 9:27 am 
Offline

Joined: Wed Feb 29, 2012 2:00 pm
Posts: 832
Try adding this.

Code:
A sword is always privately-named.


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  
Reply with quote  
PostPosted: Thu Nov 19, 2015 9:32 am 
Offline
User avatar

Joined: Sun Nov 22, 2009 12:58 pm
Posts: 706
Location: Malmö, Sweden
That would work, but disallows us from asking specifically about, say, "the keen instrument of DEATH". I'll update the question to reflect this issue.

So, good effort, but not a solution I can use.

_________________
~Björn Paulsen


Last edited by Eleas on Thu Nov 19, 2015 9:42 am, edited 1 time in total.

Top
 Profile Send private message  
Reply with quote  
PostPosted: Thu Nov 19, 2015 9:41 am 
Offline

Joined: Tue Mar 09, 2010 2:34 pm
Posts: 5082
Location: Burlington, VT
One not-very-graceful thing you could do is to allow quizzing to refer to multiple objects, and then do a Left-Hand-of-Autumn style check on the multiple object list; if the list is coextensive with the list of swords, you give the response for "swords," and if it isn't, then you give a graceful refusal. It would have the disadvantage that if the player listed every sword by hand they'd still get the "swords" response.


Top
 Profile Send private message  
Reply with quote  
PostPosted: Thu Nov 19, 2015 9:42 am 
Offline

Joined: Wed Feb 29, 2012 2:00 pm
Posts: 832
Eleas wrote:
That would work, but disallows us from asking specifically about, say, "the keen instrument of DEATH". I'll update the question to reflect this issue.

So, good effort, but not a solution I can use.


Add this.

Code:
Understand "keen/instrument/of/DEATH" as the keen instrument of DEATH.


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  
Reply with quote  
PostPosted: Thu Nov 19, 2015 9:43 am 
Offline
User avatar

Joined: Sun Nov 22, 2009 12:58 pm
Posts: 706
Location: Malmö, Sweden
matt w wrote:
One not-very-graceful thing you could do is to allow quizzing to refer to multiple objects, and then do a Left-Hand-of-Autumn style check on the multiple object list; if the list is coextensive with the list of swords, you give the response for "swords," and if it isn't, then you give a graceful refusal. It would have the disadvantage that if the player listed every sword by hand they'd still get the "swords" response.


Yeah, that was my thought. I tried something along those lines, but it was devilishly hard to generalize. I could try to do it anyway, maybe wrapped in some kind of extension. But I'd rather not.

climbingstars wrote:
Hope this helps.

Thanks. Unfortunately, I don't see how it's a workable solution if we want to generalize the understanding of subclasses. Throwing away the dictionary definitions of subclasses kinda obviates the point of even having them.

_________________
~Björn Paulsen


Last edited by Eleas on Thu Nov 19, 2015 9:47 am, edited 1 time in total.

Top
 Profile Send private message  
Reply with quote  
PostPosted: Thu Nov 19, 2015 9:45 am 
Offline

Joined: Tue Dec 25, 2007 10:06 am
Posts: 1525
I've solved the issue with:

Code:
The plural of a sword is asdaafadf.

Basically it overwrites the "swords" plural with nonsense. I know you asked for a graceful solution but...

_________________
BlogTextureVorple


Top
 Profile Send private message  
Reply with quote  
PostPosted: Thu Nov 19, 2015 9:51 am 
Offline
User avatar

Joined: Sun Nov 22, 2009 12:58 pm
Posts: 706
Location: Malmö, Sweden
Juhana wrote:
Basically it overwrites the "swords" plural with nonsense. I know you asked for a graceful solution but...


Nice!

After testing it, I think Juhana's solution is the best quick-and-dirty fix for the moment, as it fixes all my issues and retains the functionality I wanted. Thanks to everyone who jumped in to help.

_________________
~Björn Paulsen


Top
 Profile Send private message  
Reply with quote  
PostPosted: Thu Nov 19, 2015 10:14 am 
Offline

Joined: Tue Mar 09, 2010 2:34 pm
Posts: 5082
Location: Burlington, VT
Eleas wrote:
matt w wrote:
One not-very-graceful thing you could do is to allow quizzing to refer to multiple objects, and then do a Left-Hand-of-Autumn style check on the multiple object list; if the list is coextensive with the list of swords, you give the response for "swords," and if it isn't, then you give a graceful refusal. It would have the disadvantage that if the player listed every sword by hand they'd still get the "swords" response.


Yeah, that was my thought. I tried something along those lines, but it was devilishly hard to generalize. I could try to do it anyway, maybe wrapped in some kind of extension. But I'd rather not.


[EDIT: I see Juhana has come up with something but I have a solution and I'm going to post it, darn it!]

You mean, you'd like to be able to write this so it applies to the plural of anything?

...OK, I see that one problem is that there's no "[any things]" token. This seems like a lacuna. But I can fix it! Just dive into I6 to see whether we're trying to parse a quizzing action and then add everything to the scope list by hand. Here's what I got:

Code:
A sword is a kind of thing.

Understand "blade/edge/sword" as "[blade]".
Understand "[blade]" as sword.

Definition: a thing is perfect if it is nowhere.
Understand the command "ask" as something new.
Quizzing it about is an action applying to one thing and one visible thing.
Understand "ask [someone] about [things]" as quizzing it about.
To decide what action name is the action-to-be: (- action_to_be -).
After deciding the scope of the player when the action-to-be is the quizzing it about action:
   repeat with item running through things:
      place item in scope.
      
Does the player mean quizzing about a perfect thing: it is very likely.

The swordsmith is a man. Understand "smith" as the swordsmith.

The ideal sword is a sword.
Understand "blades/edges/swords" as the ideal sword.

The rakish fop is a man. The fop holds a sword called the wicked needle.
The dolorous monk is a man. The monk carries a sword called the keen instrument of DEATH.

After quizzing the swordsmith about the ideal sword, say "Yes, swords are the best!"
After quizzing the swordsmith about a sword (called blade), say "Hmm, [the blade]... not my best work, to be honest."

The forge is a room. All men are here. The player is the monk.

Test me with "ask smith about sword/ask smith about my sword/ask smith about swords".

Multiple quizzed already is a truth state that varies.
Every turn:
   now multiple quizzed already is false.

Before quizzing when multiple quizzed already is true (this is the only quiz once per turn rule): stop the action.

Before quizzing when the multiple object list is not empty (this is the check for plural quizzing rule):
   now multiple quizzed already is true;
   if the multiple object list is the same list as the list of swords:
      try quizzing the noun about the ideal sword;
   otherwise:
      say "'One question at a time, please,' says [the noun]." instead.
      
The announce items from multiple object lists rule does nothing when quizzing.
      
The only quiz once per turn rule is listed before the check for plural quizzing rule in the Before rulebook.

To decide whether (list one - a list of values) is the same list as (list two - a list of values):
   repeat with tester running through list one:
      if tester is not listed in list two:
         no;
   repeat with tester running through list two:
      if tester is not listed in list one:
         no;
   yes.


This should be fairly scalable; if you want to add other plurals, just add another clause to the check for plural quizzing rule. The spacing winds up wonky but there's probably a way to fix it.

(BTW, why oh why is it "announce items from multiple object lists"?)

EDIT: I think one advantage this has over Juhana's solution is it doesn't block "take swords."


Top
 Profile Send private message  
Reply with quote  
PostPosted: Thu Nov 19, 2015 10:18 am 
Offline
User avatar

Joined: Sun Nov 22, 2009 12:58 pm
Posts: 706
Location: Malmö, Sweden
That's a nice solution. I may end up using it. The "[any things]" token really should be a thing, though. I'd submit a suggestion to the UserVoice if only I had votes left.

_________________
~Björn Paulsen


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

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: No registered users 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