Invisible found_in object

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

Bainespal
Posts: 151
Joined: Fri Jul 09, 2010 8:59 am

Invisible found_in object

Post by Bainespal »

I'm counting on the short_desc property of a found_in object to display vital text in the room description of the two rooms in which it appears. Unfortunately, the short description isn't printed at all. The object is neither scenery nor hidden, unless Hugo treats found_in objects as if they were hidden even though I didn't give it that attribute. I'm going to try to make it work by calling the found_in object's short_desc from the two long_desc properties of the two rooms, but am I missing something more obvious?

I thought found_in objects were moved each turn into the location of the player object, when the player object is in one of the rooms in the found_in property, thus allowing them to affect the room description like any other object. However, the footnote on page 44 of the Hugo Book seems to prove me wrong:
Hugo Book wrote:The found_in property allows you have an object considered in a location (i.e., a room object) without it being “physically” in that room object.
I must have been remembering Inform when I assumed that the Library moved found_in objects to the different rooms as the player entered them.

(Note -- this is for World Builder. An object representing part of the star cruiser's interior should be displayed in both the "Space" and "In Orbit" room descriptions.)

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

Post by Roody_Yogurt »

Yeah, it sounds like you already understand the heart of the problem so I won't go into it.

The way I get around this problem is by using events like the following:

Code: Select all

event in cruiser
{
if verbroutine = &DoLookAround
	{
	"\nDang, this cruiser is so cool."
	}
}
Now, this event will run whenever it's in scope. It'll be triggered every time the player types "LOOK."

Of course, this only works when you want the item to be described last, and if you have other events, you might have to watch the order that they are defined to determine which is printed where.

Otherwise, you might be better off just hard-writing it into the long_desc's, yeah.

Post Reply