Page 1 of 1

Containers. Quiet. Hidden. Objects.

Posted: Wed Nov 26, 2008 12:56 am
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?

Posted: Wed Nov 26, 2008 8:39 am
by Worm
Can't you make the cauldron create the oyster?

Posted: Wed Nov 26, 2008 3:44 pm
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. :)

Posted: Fri Dec 03, 2010 12:47 pm
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]