Examples:
From Infocom:
The "name" command from Beyond Zork. ("Balances" contains code for
attaching names to featureless white cubes, but it's not easily
generalizable.)
The ability to address multiple NPC's at once, from Suspended. ("Both
poet and waldo, lift tripwire")
Noun-only commands, from Nord and Bert. Typing in a noun without a
verb is equivalent to "examine" or "go", depending on whether it's a
room.
From Magnetic Scrolls:
The "use" command. "Use trowel to plant pot plant in plant pot", "Use
rope to tie rake to hoe". Due to the additional internal verb, this
can't be done in general with Inform-style grammar lines. (You could
get away with a grammar line for each verb, but this seems inelegant,
considering that the grammar is really just "use [noun] to [
simple-command]".
Word order in nouns. The MS parser distinguishes "pot plant" from
"plant pot", which the Inform parser doesn't. (However, this really
only applies to Inform.)
Adjectival prepositional phrases. "Examine the cube on the table".
This would require a fairly large amount of coding to do in any system
I know of.
...Anything else I'm missing?
"Carl Muckenhoupt" <ca...@wurb.com> wrote in message
news:3ac61b3e...@News.CIS.DFN.DE...
> I've been thinking lately about the various parser improvements that
> were made during the Golden Age but which aren't (yet) part of any
> system's standard library - in particular, things done by the
> Magnetic Scrolls parser, and things done by specific Infocom games
> that never became "Infocom-standard".
Just to help by maybe (arguably) reducing the list--
> Examples:
>
> From Infocom:
>
> The "name" command from Beyond Zork. ("Balances" contains code for
> attaching names to featureless white cubes, but it's not easily
> generalizable.)
<snip more examples>
> Word order in nouns. The MS parser distinguishes "pot plant" from
> "plant pot", which the Inform parser doesn't. (However, this really
> only applies to Inform.)
>
> Adjectival prepositional phrases. "Examine the cube on the table".
> This would require a fairly large amount of coding to do in any system
> I know of.
>
> ...Anything else I'm missing?
Those three are accomplished in Platypus. Arguably, not a "system's
standard library," as you say, but altered enough from the standard Inform
library that it might be worth inclusion in such a group. Maybe not; just a
thought.
Second, here's a question for the Inform gurus--could this one (snipped out
of order)...
> The "use" command. "Use trowel to plant pot plant in plant pot", "Use
> rope to tie rake to hoe". Due to the additional internal verb, this
> can't be done in general with Inform-style grammar lines. (You could
> get away with a grammar line for each verb, but this seems inelegant,
> considering that the grammar is really just "use [noun] to [
> simple-command]".
...be done relatively easily with a BeforeParsing routine that rearranged
the general pattern of "use noun1 to Verb noun2 [preposition noun3]" to
"Verb noun2 [preposition noun3] with noun1"? I'm not too quick with
rearranging the parser's buffer and parse tables and stuff. But it seems
theoretically simple (heh--a little knowledge and all that).
Gary
I don't see why this shouldn't be a matter of using a nameVerb in TADS.
> The ability to address multiple NPC's at once, from Suspended. ("Both
> poet and waldo, lift tripwire")
Actually I presented a possible method for doing this in TADS 2. TADS 3
should be able to accomodate this kind of structure also.
> Noun-only commands, from Nord and Bert. Typing in a noun without a
> verb is equivalent to "examine" or "go", depending on whether it's a
> room.
For TADS 2 you would simply use parseNounList() in preparseCmd(). If an
object list is returned then check the object class and either append 'go'
or 'examine' to the word list and return it to the parser.
> From Magnetic Scrolls:
>
> The "use" command. "Use trowel to plant pot plant in plant pot", "Use
> rope to tie rake to hoe". Due to the additional internal verb, this
> can't be done in general with Inform-style grammar lines. (You could
> get away with a grammar line for each verb, but this seems inelegant,
> considering that the grammar is really just "use [noun] to [
> simple-command]".
In TADS 2, preparse() could use regular expression handling to restructure
the command to <<plant pot plant in plant pot>> capturing the trowel as a
global.usingObject.
> Word order in nouns. The MS parser distinguishes "pot plant" from
> "plant pot", which the Inform parser doesn't. (However, this really
> only applies to Inform.)
True, however I thought you could use parse_name to improve this.
>Second, here's a question for the Inform gurus--could this one (snipped out
>of order)...
>
>> The "use" command. "Use trowel to plant pot plant in plant pot", "Use
>> rope to tie rake to hoe". Due to the additional internal verb, this
>> can't be done in general with Inform-style grammar lines. (You could
>> get away with a grammar line for each verb, but this seems inelegant,
>> considering that the grammar is really just "use [noun] to [
>> simple-command]".
>
>...be done relatively easily with a BeforeParsing routine that rearranged
>the general pattern of "use noun1 to Verb noun2 [preposition noun3]" to
>"Verb noun2 [preposition noun3] with noun1"? I'm not too quick with
>rearranging the parser's buffer and parse tables and stuff. But it seems
>theoretically simple (heh--a little knowledge and all that).
Provided that you can tell where noun1 ends, it wouldn't be too hard.
But I think you'd run into problems if noun1 contained the word "to",
as in "use the letter to Robert to light the cigar". But perhaps
that's acceptable. Such a sentence is difficult to read even for us
humans.
> I've been thinking lately about the various parser improvements that
> were made during the Golden Age but which aren't (yet) part of any
> system's standard library - in particular, things done by the
> Magnetic Scrolls parser, and things done by specific Infocom games
> that never became "Infocom-standard".
> Examples:
> From Infocom:
> The "name" command from Beyond Zork. ("Balances" contains code for
> attaching names to featureless white cubes, but it's not easily
> generalizable.)
Ooh! I can contribute, here! Me-me-me! I actually did generalize this
into a "Nameable" class for one of my hundreds of minor projects that may
never see the light of day. I'll clean it up and probably drop it in the
archive during the week.
> The ability to address multiple NPC's at once, from Suspended. ("Both
> poet and waldo, lift tripwire")
I actually wanted something like this, as well for something. I tried to
do it, and failed pretty miserably.
> Noun-only commands, from Nord and Bert. Typing in a noun without a
> verb is equivalent to "examine" or "go", depending on whether it's a
> room.
That doesn't SOUND too difficult. In theory, one should be able to try to
parse, and on a failure, restart with Go and/or Examine as the first
word. I think...
BeforeParsing(), is it?
[...]
> Word order in nouns. The MS parser distinguishes "pot plant" from
> "plant pot", which the Inform parser doesn't. (However, this really
> only applies to Inform.)
The parse_name property does this fairly easily, doesn't it? One would
check for any adjectives except 'pot' or 'plant', check for either of the
two keywords, then check for the other (maybe checking for more adjectives
in the middle, depending).
> Adjectival prepositional phrases. "Examine the cube on the table".
> This would require a fairly large amount of coding to do in any system
> I know of.
That, too, sounds like a job for parse_name(). Something like (after
hacking through the name, itself, and assuming the parse_name on
http://www.eblong.com/zarf/inftricks/tip_parsename.html):
if (parent (self) ofclass Thing) ! Thing being a "not a room" class
{
if (wd ~= 'on' or 'in')
return (num);
! Now check for the parent object's name.
}
Hm. Let's try that before we send it out...
Yep. I'm satisfied. This isn't pretty (and only works in the one room,
although I suspect that using classes would fix that part), but it works:
Object Startroom "Someplace"
with description
"It looks like a nice place for putting things on tables.";
Object -> Table "table"
with name 'table',
description "A simple, square, wooden table.",
has supporter static;
Object -> Thingie "thingie"
with name 'thingy' 'thingie',
description "Beats me.",
parse_name
[ wd num ;
wd = NextWord();
while (WordInProperty (wd, self, name))
{
++ num ;
wd = NextWord ();
}
if (self notin Startroom or Player)
{
if (wd ~= 'on' or 'in')
return num;
++ num ;
wd = NextWord ();
while (WordInProperty (wd, parent (self), name))
{
++ num ;
wd = NextWord ();
}
}
return num;
];
> ...Anything else I'm missing?
Heh--I hope so. This is kind of fun...
Not having completed Beyond Zork, I'm not quite sure what you would like
to accomplish. Should it be possible to do
>name the plant "mimesis"
and then you should be able to use the word "mimesis" to refer to the
plant, just as if it had been decalred with that name? Wouldn't it be
possible to do that in Inform by giving each object a user_name
property, and a parse_name routine that treated user_name on the same
footing as the nouns in the name property?
>> Word order in nouns. The MS parser distinguishes "pot plant" from
>> "plant pot", which the Inform parser doesn't. (However, this really
>> only applies to Inform.)
>
>True, however I thought you could use parse_name to improve this.
You can.
--
Magnus Olsson (m...@df.lth.se, m...@pobox.com)
------ http://www.pobox.com/~mol ------
>Not having completed Beyond Zork, I'm not quite sure what you would like
>to accomplish. Should it be possible to do
>
>>name the plant "mimesis"
>
>and then you should be able to use the word "mimesis" to refer to the
>plant, just as if it had been decalred with that name?
Yes, that's exactly what it does. It also gives it a proper name, so
that it'll use the new name when referring to the object in output
text.
true. maybe I'll use this as my reason to actually tackle learning how to
actually use BeforeParsing. thanks!
Gary
I have this as part of a movement library I'm using for my WIP. It assumes
you want to "go to " the object if it's of the special class "exit". It
shouldn't be too hard to make it "look" at other objects.
Joe