intfiction.org

The Interactive Fiction Community Forum
It is currently Wed Jun 20, 2018 2:44 am

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: Mon Jun 17, 2013 1:23 am 
Offline

Joined: Sun Jun 16, 2013 10:35 pm
Posts: 16
Hello helpful people,

I have the following action defined:

Code:
Becoming is an action applying to one visible thing.

Understand "become [something]" as becoming.

Carry out becoming:
   say "Okay, you become [the noun].".

Understand the commands "b" and "be" as "become".

Test Room is a room. The player is in Test Room.


It allows the player to switch roles and become another character in the game. The actual command has a far more complicated definition, but this is enough to demonstrate the problem. I seem to be unable to get Inform to ask "what do you want to become?". See the output below:

>x
What do you want to examine?

>b
What do you want to b?

>

Inform uses the typed synonym verbatim. I had a look at the Standard Rules and couldn't find anything peculiar about how Inform was doing it for examine:

Code:
Understand the commands "x", "watch", "describe" and "check" as "examine".


What am I missing here?


Top
 Profile Send private message  
Reply with quote  
PostPosted: Mon Jun 17, 2013 6:36 am 
Offline

Joined: Sun Jun 16, 2013 10:35 pm
Posts: 16
Never mind. I searched around a little more and found the location of the substitution in LanguageVerb. I fixed it by replacing LanguageVerb with a custom routine:

Code:
Include (-
Replace LanguageVerb;
-) after "Definitions.i6t".

Include (-
[ LanguageVerb i;
   switch (i) {
     'i//','inv','inventory':
            print "take inventory";
     'l//':   print "look";
     'x//':   print "examine";
     'z//':   print "wait";
     'b//':   print "become";
     default: rfalse;
   }
   rtrue;
];
-) after "Language.i6t".


I wish there was a neater way.


Top
 Profile Send private message  
Reply with quote  
PostPosted: Mon Jun 17, 2013 10:42 am 
Offline

Joined: Sat Jan 23, 2010 4:56 pm
Posts: 5676
Another way, not really any tidier, is to use an "after reading the player's command" rule to change "b" to "become" in the input buffer.


Top
 Profile Send private message  
Reply with quote  
PostPosted: Wed Jun 19, 2013 5:46 am 
Offline

Joined: Sun Jun 16, 2013 10:35 pm
Posts: 16
Hrmm... along those lines, this is what I've come up with:

Code:
To decide which snippet is the player's verb:
   (- verb_wordnum * 100 + 1 -).

Repeating the player's verb is an activity.

Rule for repeating the player's verb:
   say the player's verb.

Rule for repeating the player's verb when the player's verb matches "i" or the player's verb matches "inv" or the player's verb matches "inventory":
   say "take inventory";

Rule for repeating the player's verb when the player's verb matches "x":
   say "examine";

Rule for repeating the player's verb when the player's verb matches "l":
   say "look";

Rule for repeating the player's verb when the player's verb matches "z":
   say "wait";

This is the language verb rule:
   carry out the repeating the player's verb activity.

Include (-
Replace LanguageVerb;
-) after "Definitions.i6t".

Include (-
[ LanguageVerb;
   (+ language verb rule+)();
   rtrue;
];

-) after "Language.i6t".


I thought it best to scan only the verb in question, not the entire input buffer. It works well.

My original effort, however, included a verb property for the activity:

Code:
To decide which snippet is the verb in the player's command:
   (- verb_wordnum * 100 + 1 -).

Repeating the player's verb is an activity.

The repeating the player's verb activity has a snippet called the verb.

Before repeating the player's verb: now the verb is the player's verb.

Rule for repeating the player's verb:
   say the player's verb.

Rule for repeating the player's verb when the verb matches "i" or the verb matches "inv" or the verb matches "inventory":
   say "take inventory";

Rule for repeating the player's verb when the verb matches "x":
   say "examine";

Rule for repeating the player's verb when the verb matches "l":
   say "look";

Rule for repeating the player's verb when the verb matches "z":
   say "wait";

This is the language verb rule:
   carry out the repeating the player's verb activity.

Include (-
Replace LanguageVerb;
-) after "Definitions.i6t".

Include (-
[ LanguageVerb;
   (+ language verb rule+)();
   rtrue;
];

-) after "Language.i6t".


When I compiled the original, I got errors like:

In the sentence 'Rule for repeating the player's verb when the verb matches "l"' , I was expecting to read a value, but instead found some text that I couldn't understand - 'verb'.

And I wasn't sure what was wrong. It seems Inform doesn't like the extra level of indirection ("the verb"), but only if I list more than one rule with "the verb". Does this make sense to anyone?


Top
 Profile Send private message  
Reply with quote  
PostPosted: Wed Jun 19, 2013 10:15 am 
Offline

Joined: Wed Oct 27, 2010 6:15 pm
Posts: 344
I believe that you've run into bug 410.


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