How do I fix this problem?

Post a reply


This question is a means of preventing automated form submissions by spambots.
Smilies
:smile: :sad: :eek: :shock: :cool: :-x :razz: :oops: :evil: :twisted: :wink: :idea: :arrow: :neutral: :mrgreen:

BBCode is ON
[img] is ON
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: How do I fix this problem?

Re: How do I fix this problem?

by bryanb » Tue Nov 12, 2019 6:04 pm

Flack wrote: Mon Nov 11, 2019 1:23 pm People playing interactive fiction games understand that stairs go up and down, and will simply type "up" to go up and "down" to go down.
Well, some will. In reality, it's hard to predict what users are going to type in a given situation. I think you have to assume they're crazy and utterly nonstandard until proven otherwise. Even the same user won't always type the same thing in every game or in every situation. I think I would usually use "up" and "down" in a stairs situation as you suggested, but I definitely will sometimes use "climb up stairs" or "climb up" as well. The best parsers are the most accommodative, period.

Re: How do I fix this problem?

by Roody_Yogurt » Mon Nov 11, 2019 3:35 pm

If you read the section on grammar in the Hugo manual, grammar has to be declared in a certain order to work properly.

Code: Select all

verb "climb"
 * "up" transport		DoClimbUpTrans
 * "down" transport	        DoClimbDownTrans
 * "on" "board" transport	DoBoardTrans
 * "on" transport		DoClimbOnTrans
 * "off" transport		DoClimbOffTrans
 ! * "off" "of" transport		DoClimbOffTrans
 * transport			DoClimbTrans
(The line with "of" in it isn't even needed since Hugo automatically removes it from commands.)

As you can see, the simplest version of the command should always be listed last with ones with extra words declared first. I only tested the commands you said didn't work, and they worked fine for me.

Re: How do I fix this problem?

by Tdarcos » Mon Nov 11, 2019 3:30 pm

Ice Cream Jonsey wrote: Mon Nov 11, 2019 11:28 am … knows what… "up" and "down" are… You are using them as adjectives. Can you add those words as adjectives to your stairs object and see what happens?
Which "up" do you want, 1) above 2) steps?

Yeah, tried that.

Re: How do I fix this problem?

by Flack » Mon Nov 11, 2019 1:23 pm

Tdarcos wrote: Mon Nov 11, 2019 12:30 am

Code: Select all

verb "climb"
 * transport			DoClimbTrans
 * "up" transport		DoClimbUpTrans
 * "down" transport	        DoClimbDownTrans
 * "on" transport		DoClimbOnTrans
 * "on" "board" transport	DoBoardTrans
 * "off" transport		DoClimbOffTrans
 * "off" "of" transport		DoClimbOffTrans
People playing interactive fiction games understand that stairs go up and down, and will simply type "up" to go up and "down" to go down. You're trying to solve a problem that doesn't exist.

Re: How do I fix this problem?

by Ice Cream Jonsey » Mon Nov 11, 2019 11:28 am

I think what it is going on is that it knows what the word "up" and "down" are but thinks they are directions. You are using them as adjectives. Can you add those words as adjectives to your stairs object and see what happens?

Re: How do I fix this problem?

by Tdarcos » Mon Nov 11, 2019 9:22 am

Jizaboz wrote: Mon Nov 11, 2019 1:03 am Are you sure your stairs or whatever are in scope? Ie; the error message you are getting tells me the object you are trying to interact with is not in the same “room”
As I said, typing "climb on stairs' works and if I change "up" to "xx" in the grammar, "climb xx stairs" works.

With a little bit of work i discovered that because of u_obj having the noun of up, it turns up into an object. So typing "up stairs' it sees that as two objects together, with no separating words, which breaks the rules. Or I think so, if I have object xobject in grammar, t I can see what that does.

Re: How do I fix this problem?

by Jizaboz » Mon Nov 11, 2019 1:03 am

Are you sure your stairs or whatever are in scope? Ie; the error message you are getting tells me the object you are trying to interact with is not in the same “room”

How do I fix this problem?

by Tdarcos » Mon Nov 11, 2019 12:30 am

I've started writing a new interactive fiction game and have found an interesting peccadillo in Hugo (or else I'm not doing this right).

In this example, transport is a declared attribute.
Take the following grammar:

Code: Select all

verb "climb"
 * transport			DoClimbTrans
 * "up" transport		DoClimbUpTrans
 * "down" transport	        DoClimbDownTrans
 * "on" transport		DoClimbOnTrans
 * "on" "board" transport	DoBoardTrans
 * "off" transport		DoClimbOffTrans
 * "off" "of" transport		DoClimbOffTrans
There is an object in the game with the noun steps which has is transport. So the commands
>climb stairs
>climb on stairs
do work, but
>climb up stairs
>climb down stairs
get the error message beginning with "You haven't encountered anything like that." A global search on "haven't encountered anything" produces no hits. So I'm figuring this is a message from the game engine. However, if I edit the above to:

Code: Select all

verb "climb"
 * transport			DoClimbTrans
 * "xx" transport		DoClimbUpTrans
 * "xxxx" transport	        DoClimbDownTrans
 * "on" transport		DoClimbOnTrans
 * "on" "board" transport	DoBoardTrans
 * "off" transport		DoClimbOffTrans
 * "off" "of" transport		DoClimbOffTrans
then the commands
>climb xx stairs
>limb xxxx stairs
work correctly.

Is it that the system does not like intermediate words that match other verbs? In writing this i can probably "get around" this by substituting the attribute direction for "up" or "down" and filter it either in DoClimbUp or in the object's before routine to check for the direction being up or down. (And it's probably a good idea to change the name of the routine.)

Top