More for the Wish List

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

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

More for the Wish List

Post by Merk »

Here are a couple other things I've run into and coded around. Easy to code around, but either of these things might be good for inclusion in a future version of the library... :)

1) The default library behavior for "read" (and "peruse") is to call the &DoLook routine. There were times when I wanted "looking" at something to work differently than "reading" something. How I handled it was, I replaced the read/peruse verb with a call to DoRead instead of DoLook. All the DoRead() routine does is to perform(&DoLook, object). That maintains the existing behavior that "read" is synonymous with "look" (for objects that are readable), but it allows "before object DoRead" trapping on readable objects, to optionally provide a different response that "look" would give.

2) There are times when I want to describe something when the room description is shown -- scenery, usually -- but still give a short description whenever the room description *isn't* shown. Here's an example. Put a "large hole" object in a room. When you enter the room for the first time, or "look" to re-display later, a very description sentence/paragraph follows, describing the look of the hole and its placement within the room. When re-entering later (in terse mode), it's still a convenience to the player if a brief message "a large hole is in the middle of the room" is shown. The initial_desc property doesn't really accomplish this, because (a) the hole is never moved, and (b) if you flag it artifically as moved, you won't see the long version when the room desc is shown later. The best way I found for this to work is to add a "roomdesc_seen" global, which is set to FALSE each pass through main(). Then, in the long_desc() of *every* room, set roomdesc_seen to TRUE. Then, in the short_desc for the "large hole", a different message can be shown depending on whether or not the room description was just seen. Might it be possible to do something like this in the library -- basically, give some kind of a flag that means "room desc was seen", resetting to false each time through the game loop? Or, even add a new default property available to all objects, that works like "initial_desc" except called "courtesy_desc" (or something) -- shown with priority over "short_desc" if the routine exists and the room description has not been seen in this turn.