Description Types

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

SoonMinYee
Posts: 1
Joined: Mon May 03, 2004 8:25 pm

Description Types

Post by SoonMinYee »

I'm wondering if it is possible to somehow have different types of descriptions. How would I code something like that in Hugo? To give an idea of what I mean, I guess I would like to make something where you have your normal long_desc but there is something else like impression_desc or somthing like that. And impression_desc would be the player character's "impression" of a room that they have seen.

Does that make sense?

Guest

Post by Guest »

I should probably add that idea would be that user could type some command or something to get the "impression". Or maybe better thing is something like "memory_desc" property. And then user types "remember room x" and the memory_desc is called. Does that kind of thing make sense?

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

Post by Ice Cream Jonsey »

You betcha. I did something similar in a couple of cases: I created a

break_desc token to be run when a breakable object is broken and a data_desc to be run when a data object is placed within something like a CD-ROM.

Here's a quick way to whip it up:


1) Place property memory_descript below your #includes, in your main gamename.hug file. Actually, you probably want to put an attribute rememberable in there as well, as it makes things easier later on.

2) For objects that you wish to have the character be able to recall, just put in something for that like you would long_desc. For example:

Code: Select all

LightRoom Basement "Basement"
{
is rememberable

 long_desc
 {
    "It's your basement! Oh no, it's flooded!"
 }

 memory_desc
 {  
    "You recall all the adventures of your basement and tug up on your pant legs in memory."
 }

}
3) OK, now you want to create a verb for "remember."

Code: Select all

verb "remember"
	*		DoVague
	* rememerable	DoRemember
4) Lastly, just make the following routine:

Code: Select all

routine DoRemember(object)
{
   run object.memory_desc
}

I think that the object will get passed to you automatically from the verb definition. If it doesn't, you'd want to change the above line to * rememberable DoRemember(object) but I am pretty sure that's not necessary.

Let me know if any of this seems unclear. I'd be happy to whip up a fully-compilable example source for you.

Robb
the dark and gritty...Ice Cream Jonsey!

Cryptonomic
Posts: 55
Joined: Wed May 05, 2004 4:35 am
Location: Chicago, IL
Contact:

Post by Cryptonomic »

Actually, this is very similar to a question I was going to pose as well after finding this board. I am using Hugo for my first work of Interactive Fiction and one of the things I was doing to do was tell the story in first-person perspective. And part of that was the ability to not so much "memorize" things (although I guess that makes sense), but to allow for something like the "first impression" concept.

I am also wondering if this somehow might tie into another element I eventually want to get into, since it would probably involve some property of this sort.

My goal there would be to have a way that the player could type "what is {X}?", where {x} would be some object, or "who is {x}?", where {x} would be some NPC. So instead of memory_desc or impression_desc, I might have who_desc and what_desc.

Does that sort of make sense?

Debaser
Posts: 878
Joined: Tue Jun 25, 2002 9:55 pm
Location: Aurora, IL

Post by Debaser »

Cryptonomic wrote: My goal there would be to have a way that the player could type "what is {X}?", where {x} would be some object, or "who is {x}?", where {x} would be some NPC. So instead of memory_desc or impression_desc, I might have who_desc and what_desc.

Does that sort of make sense?
That's actually a really good idea. It would be easy enough, too. All you'd have to do is set up your verbs like:

Code: Select all

verb "who" "what"
 *      DoVague
 * "is" Object    DoWhatIs


And then you'd just set up a DoWhatIs routine "what_desc" property like Robb has outlined above. You could also do "who" and "what" as seperate verbs if you liked, obviously, though the opinion of the author of this post is that that's unneccessary.

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

Post by Kent »

With regard to

Code: Select all

routine DoRemember(object)
{
   run object.memory_desc
}
you might try a somewhat more elaborate version:

Code: Select all

routine DoRemember(object)
{
    if object.memory_desc
        return true
    else
    {
        "You can't recall anything in particular about ";
        print The(object); "."
    }
}
since this provides a back-up in case you don't provide a memory_desc for every object that might be referred to.

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

Post by Ice Cream Jonsey »

Cryptonomic wrote:Actually, this is very similar to a question I was going to pose as well after finding this board. I am using Hugo for my first work of Interactive Fiction and one of the things I was doing to do was tell the story in first-person perspective. And part of that was the ability to not so much "memorize" things (although I guess that makes sense), but to allow for something like the "first impression" concept.
Welcome to JC! You probably saw it already in either sample code or the manual, but just in case -- Hugo has a flag to let you put your game into either first or third person. You probably noticed that already, but when I wrote my first one I didn't and I consequently spent a ridiculous amount of time changing over the library by hand. So I'm now the Hugo equivalent of that annoying guy who got three DUIs in a year and is out to ruin the good times all his friends that drink much more responsibly than he ever did when they go out, asking for everyone's keys when they haven't even averaged a drink per two hours much less one ... I mean, going "NARRATOR FLAG NARRATOR FLAG!" over and over again.
the dark and gritty...Ice Cream Jonsey!

Post Reply