How do I fix this problem?
Posted: 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:
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:
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.)
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
>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
>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.)