This is a discussion / support forum for the Hugo programming language by Kent Tessman. Hugo is a powerful programming language for making text games / interactive fiction with multimedia support.
I'm trying to have a faucet in a sink that the user can get water out of it. I'll flesh it out but I just want to have the system recognize I can do this.
object sink "sink"
{
in Kitchen
article "a"
is static, container
}
object faucet "faucet"
{
in Sink
article "a"
is static, openable
is not open
}
This is what happens (forget the redundant descriptions, I'll drop those later):
You're in the control center
You are in the main control center. You can go in any of the twelve directions from here.
>in
You're in the kitchen off the control center
You are in a typical kitchen/break room of an office but expanded since people often spend considerably more time than normal here. There is a stove with an
oven, a refrigerator, a microwave oven, a sink with a faucet, a coffee pot on a coffee maker, and some packets of coffee sitting on the counter. There really
isn't much you'd want to do here. Go OUT to return to the control center.
A stove with an oven, a microwave oven, a sink, a refrigerator, and a coffee maker are here. Inside the sink is a faucet. Sitting on the coffee maker is a
coffee pot.
>open faucet
That doesn't make any sense.
If faucet is a component instead of an object then it doesn't show up as being in the sink. And I still can't open it. Funny, it worked for the drain valve in Teleporter Test, only that was in the room, not in an object. Do I have to tell the sink or the faucet it's reachable from the kitchen or something?
"When I die, I want it easy and peaceful in my sleep, like my uncle.
Not screaming and crying like his passengers."
object faucet "faucet"
{
in Sink
article "a"
adjectives "faucet"
is static, openable
is not open
}
I needed to give the faucet an adjective even though it was the same as its name, and then it will recognize the "open" command. I think I'll add "turn" and "on" and "off" for it too.
"When I die, I want it easy and peaceful in my sleep, like my uncle.
Not screaming and crying like his passengers."
Actually, instead of adjective, you should be giving it the noun "faucet" (and yes, the noun and adjective properties are completely separate from the name property, as far as the parser is concerned).
Roody_Yogurt wrote:Actually, instead of adjective, you should be giving it the noun "faucet" (and yes, the noun and adjective properties are completely separate from the name property, as far as the parser is concerned).
Why, what's the significance? Is there a reason for using "noun" (or is it "nouns", or both) over "adjectives", and why do you say "adjective", is that just straight English response or is it also an alias for "adjectives"? How would you know which?
Thanks for the suggestion, right now I just have the faucet in the kitchen sink to fill the coffee pot. It provides a whole bunch of fun things. The coffee pot is initially on top of the coffee maker empty, if you start the coffee maker without putting water in the pot, the (dry) coffee pot shatters and melts. If you say "fill pot" or "fill pot from faucet" and you left the pot on the coffeemaker, it tells you you're not holding it. If you didn't start the faucet it tells you it's not running. (Oh damn, I need to add the verb "run" so someone can "run faucet" if it's not there.) So then you can put the pot on the coffee maker and start it, to get a pot of hot water. So I don't think I need that much capability yet.
Actually, come to think of it I might use the plumbing capability in the other bathroom.
"When I die, I want it easy and peaceful in my sleep, like my uncle.
Not screaming and crying like his passengers."
Roody_Yogurt wrote:Actually, instead of adjective, you should be giving it the noun "faucet" (and yes, the noun and adjective properties are completely separate from the name property, as far as the parser is concerned).
Why, what's the significance? Is there a reason for using "noun" (or is it "nouns", or both) over "adjectives", and why do you say "adjective", is that just straight English response or is it also an alias for "adjectives"? How would you know which?
I believe the parser gives higher priority to noun properties over adjective properties, so if you have another object with "faucet" as a noun, that object will always be chosen, instead of getting a proper, 'Which faucet do you mean?' response (of course, it's unlikely that you'll have two faucets in one room, but still, there's something to be said about doing things the right way).
And yeah, "adjectives" is an alias of "adjective" and "nouns" is an alias of "noun." I usually just refer to the single form.
Roody_Yogurt wrote:
I believe the parser gives higher priority to noun properties over adjective properties, so if you have another object with "faucet" as a noun, that object will always be chosen, instead of getting a proper, 'Which faucet do you mean?' response (of course, it's unlikely that you'll have two faucets in one room, but still, there's something to be said about doing things the right way).
Also, my understanding of the Hugo Book (page 46 according to the notation on the page, literally page 56 in the PDF doc) is that any combination of adjectives can come before a noun in the player's command. So, if the adjectives were "leaky" and "silver" and the noun was "faucet," the player could type "X LEAKY SILVER FAUCET" or "X SILVER" but not "X FAUCET SILVER LEAKY".