Containers / Objects inside them / "known" attribu

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.

Hugo download links: https://www.generalcoffee.com/hugo
Roody Yogurt's Hugo Blog: https://notdeadhugo.blogspot.com
The Hugor interpreter by RealNC: http://ifwiki.org/index.php/Hugor

Moderators: Ice Cream Jonsey, joltcountry

User avatar
Ice Cream Jonsey
Posts: 30193
Joined: Sat Apr 27, 2002 2:44 pm
Location: Colorado
Contact:

Containers / Objects inside them / "known" attribu

Post by Ice Cream Jonsey »

Say, anyone know how to deal with the following?

I have a container. It's got the following attributes:

is container, enterable, quiet, hidden, transparent

I have an object that is in the container. It's actually "water." I gave it the attribute known because I want people to be able to do the following:

o Walk into a room
o See an object that would obviously contain water
o type in >get some water
o be given the water

But as it stands now, my container object keeps the water from being refered to, even though the attribute known has been given to the water.

Any advice?


(Note: I kept the object an "object" and not "scenery" because I wanted it to be enterable, and my understanding is that scenery being enterable causes some problems. But I can't remember what problems, as I didn't document it. Maybe it's all in my head. But ultimately, I don't want the contents of the container object listed in the room's description, but I do want them listed when someone >LOOKS at the object... If that clarifies things at all.)
the dark and gritty...Ice Cream Jonsey!

Kent
Posts: 119
Joined: Fri Jun 27, 2003 12:10 pm

The quiet attribute

Post by Kent »

Really the 'quiet' attribute is supposed to be an initial-state sort of thing. Like, if you have a garbage can that is quiet, you don't get its contents until you look in it, after which the quiet attribute is (by default) cleared and the contents are from then on listed as normal.

Now, if you're trying to suppress the water from actually appearing as a normal child object, you might do one of two things:

1. Don't explicitly put the water 'in' the container but instead use a found_in property on the water object. This way it's not "in" the object tree as a child of the container so the listing routine doesn't list it.

or

2. Meddle with the container's list_contents property. This is a little trickier and possibly overkill, but something to try if for whatever reason (1) doesn't cut it.

User avatar
Ice Cream Jonsey
Posts: 30193
Joined: Sat Apr 27, 2002 2:44 pm
Location: Colorado
Contact:

Post by Ice Cream Jonsey »

Meant to say "thanks" for this -- didn't get a chance to try it out until now, though. Thanks!
the dark and gritty...Ice Cream Jonsey!

Post Reply