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?
Description Types
Moderators: Ice Cream Jonsey, joltcountry
- Ice Cream Jonsey
- Posts: 30193
- Joined: Sat Apr 27, 2002 2:44 pm
- Location: Colorado
- Contact:
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:
3) OK, now you want to create a verb for "remember."
4) Lastly, just make the following routine:
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
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."
}
}
Code: Select all
verb "remember"
* DoVague
* rememerable DoRemember
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!
-
- Posts: 55
- Joined: Wed May 05, 2004 4:35 am
- Location: Chicago, IL
- Contact:
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?
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?
-
- Posts: 878
- Joined: Tue Jun 25, 2002 9:55 pm
- Location: Aurora, IL
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: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?
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.
-
- Posts: 119
- Joined: Fri Jun 27, 2003 12:10 pm
With regard to
you might try a somewhat more elaborate version:
since this provides a back-up in case you don't provide a memory_desc for every object that might be referred to.
Code: Select all
routine DoRemember(object)
{
run object.memory_desc
}
Code: Select all
routine DoRemember(object)
{
if object.memory_desc
return true
else
{
"You can't recall anything in particular about ";
print The(object); "."
}
}
- Ice Cream Jonsey
- Posts: 30193
- Joined: Sat Apr 27, 2002 2:44 pm
- Location: Colorado
- Contact:
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.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.
the dark and gritty...Ice Cream Jonsey!