Reply-To: "Kent Tessman" <kent@remove-to-reply.generalcoffee.com>
From: "Kent Tessman" <kent@remove-to-reply.generalcoffee.com>
Newsgroups: rec.arts.int-fiction
References: <g7ni7ugr8a8nfvb22t8sjgbjtqku4sdci8@4ax.com> <6Qje8.2224$q47.512957@news20.bellglobal.com>
Subject: Re: [HUGO]  How to preclude player seeing parser errors?
Lines: 79
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2600.0000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
Message-ID: <__je8.2252$q47.519146@news20.bellglobal.com>
Date: Mon, 25 Feb 2002 00:31:40 -0500
NNTP-Posting-Host: 64.229.226.153
X-Complaints-To: abuse@sympatico.ca
X-Trace: news20.bellglobal.com 1014615098 64.229.226.153 (Mon, 25 Feb 2002 00:31:38 EST)
NNTP-Posting-Date: Mon, 25 Feb 2002 00:31:38 EST
Organization: Bell Sympatico
Path: news.duke.edu!newsgate.duke.edu!zombie.ncsc.mil!alnews.ncsc.mil!feed.news.qwest.net!torn!webster!nf1.bellglobal.com!nf2.bellglobal.com!news20.bellglobal.com.POSTED!not-for-mail
Xref: news.duke.edu rec.arts.int-fiction:100660

[Okay, now that I've learned how to use my newsreader and your newfangled
Internet, I'll actually post a message and not just an empty response.]

The problem is really that the dispatch to the character happens after the
parser has determined what exactly the player typed.  Until it does that, it
can't decide to direct the action to a particular character, and if it runs
into an error in parsing, it will never get to that dispatch stage.

The most immediate solution is probably to replace the ParseError routine,
which will get called for any parse-time error.  Namely, at the start,
determine if the first word (word[1]) in the phrase is part of the object's
name.  Something like this should do the trick:

replace ParseError(errornumber, obj)
{
    if InList(the_character, nouns, word[1]) or InList(the_character,
adjectives, word[1])
    {
        "[Your response here.]"
        return true
    }

    ...Normal ParseError routine continues here...
}

Hope that's at least a start.

--Kent

"Kent Tessman" <kent@remove-to-reply.generalcoffee.com> wrote in message
news:6Qje8.2224$q47.512957@news20.bellglobal.com...
>
> "Dana Clarke" <joeynipp@bellsouth.net> wrote in message
> news:g7ni7ugr8a8nfvb22t8sjgbjtqku4sdci8@4ax.com...
> > First, I want to thank everybody for all the help they have given me
> > so far with HUGO.  The process of learning all about HUGO is, however,
> > depressing my ego further than I though possible <g>.  So, on to my
> > current issue.
> >
> > I have a certain (only one so far) npc who I need to respond to each
> > and every command with a certain phrase.  I though certainly the
> > proper approach (with my severely limited understanding of HUGO) would
> > be to define (within the npc's definition block) his "order_response"
> > and so I did thusly:
> >
> > order_response
> > {
> > print "As you wish."
> > }
> >
> > This seems most straightforward to my albeit simple mind.
> >
> > It works just fine.
> >
> > EXCEPT..... If the player chooses to issue a command with a direct
> > object that is NOT defined, the parser (I suspect it is coming from
> > there) politely issues a response back to the player that basically
> > says: "You cannot use that word" - or something to that effect.  For
> > instance, if the player types: "Fred, get the food." but I do not have
> > a "food" object defined, the parser barfs out (please excuse the
> > technical lingo here).
> >
> > But remember I said I wanted "As you wish." to be the response the
> > player received for ANY command issued to the npc - and I do NOT want
> > to have to enter all possible words the player might use as a direct
> > object - nor do I wish to have to imagine all possible verbs the
> > player might try to issue as a command to this particular npc.
> >
> > So, is there some way to, in effect, bypass the parser in this
> > situation only so that no matter what command the player issues to
> > Fred, he will respond with "As you wish."?
> >
> > Thank you for your studied opinions
> > Dana (aka too loose to track)
> >
>
>


