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.)
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, [color=#00ffff][b]transport[/b] [/color] is a declared attribute.
Take the following grammar:
[code]
verb "climb"
* transport DoClimbTrans
* "up" transport DoClimbUpTrans
* "down" transport DoClimbDownTrans
* "on" transport DoClimbOnTrans
* "on" "board" transport DoBoardTrans
* "off" transport DoClimbOffTrans
* "off" "of" transport DoClimbOffTrans
[/code]
There is an object in the game with the noun [color=#00ffff][b]steps[/b][/color] which has [color=#00ffff][b]is transport[/b][/color]. 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]
verb "climb"
* transport DoClimbTrans
* "xx" transport DoClimbUpTrans
* "xxxx" transport DoClimbDownTrans
* "on" transport DoClimbOnTrans
* "on" "board" transport DoBoardTrans
* "off" transport DoClimbOffTrans
* "off" "of" transport DoClimbOffTrans
[/code]
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 [color=#00ffff][b]direction[/b][/color] for [b][color=#00FFFF]"up"[/color][/b] or [color=#00FFFF]"down"[/color] and filter it either in DoClimbUp or in the object's [b][color=#00ffff]before[/color][/b] routine to check for the direction being up or down. (And it's probably a good idea to change the name of the routine.)