MOO-cows Mailing List Archive
[Prev][Next][Index][Thread]
Re: Parser Problem
>On Wed, 30 Aug 1995, Tom Ritchford wrote:
>
>[snip]
>
>> Once you've set the preposition to be none, there can be no
>> iobjstr and iobj. So @junk is really @junk this none none.
>>
>> In the second example, it tries to match the string "me nothing" against an
>> object and fails. Thus, the dobj is $nothing... but the dobj has to be
>> "this" in order for the verb to match. So no match and the error above.
>
>As I suspected. The crux of my question is whether there is a workaround
>or if there is an inherent proscription on constructs such as "@pay bob
>$10." I doubt it (a workaround), but maybe someone's been very, very
>clever.
>
Here's a code fragment from some working code that does much like
that.
name = argstr[1..index(argstr, " ") - 1];
object = argstr[index(argstr, " ") + 1..length(argstr)];
who = player.location:match_object(name);
"Remove this next 2 lines if you only want to match objects";
"in the current location";
if (!valid(who))
who = $string_utils:match_player(name);
endif
if (valid(who))
"You found a player";
"Do something similar for the object";
endif
/t
Tom Ritchford tom@mvision.com (212) 306-0414
Market Vision, 40 Rector Street, NY, NY 10006
Verge's "Little Idiot" -- coming soon to a player near you!
References:
Home |
Subject Index |
Thread Index