Containers. Quiet. Hidden. Objects.

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: 30184
Joined: Sat Apr 27, 2002 2:44 pm
Location: Colorado
Contact:

Containers. Quiet. Hidden. Objects.

Post by Ice Cream Jonsey »

OK, there is something that absolutely drives me nuts in Hugo. I must be doing it wrong. It's probable that I f'ed up the library.

I constantly find myself in a situation as follows:

1) I have an object like, say, a cauldron.
2) Inside the cauldron is an oyster.
3) I use the "if self is not visited" bit to mention the oysters. I might say something like, "You smell the scent of oysters here!"
4) I set the oysters to be in the cauldron.

OK, so far so good.

- When the player enters the room, he is going to see something like:

There is a cauldron here. Inside the cauldron is the oyster.

I hate hate hate how that looks.

What I would prefer it do is say nothing about the oysters. I'd like the game to say:

There is a cauldron here.

I can get the above to happen if I set the oyster to be hidden. Then it won't be listed as contents for the cauldron. But this also means that the player cannot >look at it! Infuriating!

I can't even set the cauldron to be scenery because even if I did, I have situations where I want a particular non-player character to have items that are described elsewhere, not listed when the room description lists the contents of things, and yet still addressable by the player.

Am I missing something easy, regarding this?
the dark and gritty...Ice Cream Jonsey!

Worm
Posts: 3626
Joined: Sat Aug 24, 2002 12:53 am
Location: tucked away between the folds of your momma, safe

Post by Worm »

Can't you make the cauldron create the oyster?
Good point Bobby!

Merk
Posts: 192
Joined: Mon Nov 22, 2004 3:19 pm
Location: Wichita, KS
Contact:

Post by Merk »

You need to override list_contents{ } for the cauldron. I can give you an example if needed, but I'm feeding a baby at the moment. :)

Roody_Yogurt
Posts: 2256
Joined: Mon Apr 29, 2002 6:23 pm
Location: Milwaukee

Post by Roody_Yogurt »

Today, I've been looking at the old posts on here and coming up with my own solutions to the problems.

I played with this one for a while. Initially, I had the oysters set as hidden and had to have a before to temporarily set them as not hidden so that DoLookIn could work properly.

Eventually, I just went with this, using code from the dresser from Guilty Bastards:

Code: Select all

object cauldron "cauldron"
{
	noun "cauldron"
	in CauldronRoom
	is container, open
	list_contents
	{
		! Skip contents-listing if not looking specifically inside
		if verbroutine ~= &DoLookIn
			return 1
		else
			{
			return 0
			}
	} 
}

object oysters "oysters"
{
	noun "oysters"
	is plural
	in cauldron
}
[/code]

Post Reply