I have a situation where:
First move of the game is open the cabinet
Second move of the game is to get a shirt out of that cabinet
When the player types
>give it to soandso
Hugo insists that I mean the first thing, the cabinet. I can't believe I have never had this issue before, it's got to be because it's the start of the game?
I have tried assigning object and xobject to the shirt after it is taken. I just do not get it.
Do you guys know how Hugo comes to the determination that the object I mean is a piece of scenery that was not the last thing referenced?
(assuming you mean)
Moderators: Ice Cream Jonsey, joltcountry
- Ice Cream Jonsey
- Posts: 30175
- Joined: Sat Apr 27, 2002 2:44 pm
- Location: Colorado
- Contact:
(assuming you mean)
the dark and gritty...Ice Cream Jonsey!
- Ice Cream Jonsey
- Posts: 30175
- Joined: Sat Apr 27, 2002 2:44 pm
- Location: Colorado
- Contact:
Re: (assuming you mean)
I solved it by giving the jumpsuit a pronoun of "it" but still Weird.
the dark and gritty...Ice Cream Jonsey!
- Tdarcos
- Posts: 9556
- Joined: Fri May 16, 2008 9:25 am
- Location: Arlington, Virginia
- Contact:
Re: (assuming you mean)
I did a search of hugolib / verblib / objlib to find and examine the "take" verb which redirects to "get". And I found what's missing in your case. You need to give the cabinet the attribute "static", which is something the player can't take. Try putting "is static" in the definition of the cabinet (and possibly the drawer, if that is an additional object). I suspect this will fix your problem, as then the only item in the room the player legally can take is the shirt.Ice Cream Jonsey wrote: Sun Sep 01, 2019 5:12 pm When the player types
>give it to soandso
Hugo insists that I mean the first thing, the cabinet. I can't believe I have never had this issue before, it's got to be because it's the start of the game?
Do you guys know how Hugo comes to the determination that the object I mean is a piece of scenery that was not the last thing referenced?
"When I die, I want it easy and peaceful in my sleep, like my uncle.
Not screaming and crying like his passengers."
Not screaming and crying like his passengers."
- Ice Cream Jonsey
- Posts: 30175
- Joined: Sat Apr 27, 2002 2:44 pm
- Location: Colorado
- Contact:
-
- Posts: 2255
- Joined: Mon Apr 29, 2002 6:23 pm
- Location: Milwaukee
Re: (assuming you mean)
Roodylib actually has something for this. It's mentioned in the Roodylib "docs" in the Pronouns section under SetPronoun. Ideally, it's a routine you can replace with pronoun-setting rules, but Roodylib doesn't actually make such rules because I'm not sure any set of rules would apply to every game.
Like, in my game "the Halloween Horror":
To help with the rule-making, Roodylib keeps track of some additional globals that remember the last turn: last_verbroutine, last_object, and last_xobject (actually, I think I made these globals for something else but it helps out here, too). So between that and verbroutine, object, and xobject, you should be able to make some rules you are happy with.
In your instance, maybe something like this?
Like, in my game "the Halloween Horror":
You would want the "it" obect set to the microwave, right? But imagine some kind of Zork Zero cauldron.>PUT POPCORN IN MICROWAVE
You put the popcorn in the microwave.
>CLOSE IT
In this instance, it makes more sense that "it" refers to the cauldron, right? Maybe the distinction has something to do with openable-vs-non-openable containers, but I imagine it's just as likely to be best addressed on a case-by-case manner.>PUT THING IN CAULDRON
You throw the thing into the cauldron.
>EXAMINE IT
The cauldron bubbles with greater intensity now.
To help with the rule-making, Roodylib keeps track of some additional globals that remember the last turn: last_verbroutine, last_object, and last_xobject (actually, I think I made these globals for something else but it helps out here, too). So between that and verbroutine, object, and xobject, you should be able to make some rules you are happy with.
In your instance, maybe something like this?
This system hasn't gotten a lot of testing so I'm not 100% sure this won't break something. I'll definitely take a closer look at all of this as I get back into Roodylib stuff.replace SetPronouns
{
if it_obj = last_xobject
{
if not ((verbroutine = &DoClose, &DoOpen) and not xobject) or (verbroutine = &DoPutIn and object = xobject )
{
object = last_object
AssignPronoun(last_object)
}
}
}
-
- Posts: 2255
- Joined: Mon Apr 29, 2002 6:23 pm
- Location: Milwaukee
Re: (assuming you mean)
So, for days, I've been meaning to add some more pronoun-fixing code to Roodylib. Last night, I finally got around to putting together a test game to reacquaint myself with how things currently work before I go "fixing" things.
I was only able to replicate this issue with hugolib without roodylib (and funnily enough, if one UNDOs and then tries the same command again, it gets it right the second time). Pronoun-handling in Hugo's standard library always was a little slapdash. Without remembering the specifics of everything I did, I know I tried to make things a little more consistent in Roodylib. In Roodylib, it seems it almost always applies the "it" object to the object, which seems to work for the most part.
I think I might add some code to Parse which checks the context (like whether the verb is something like "open"/"close") and chooses the "it" object based what fits, but other than that, I guess I'm already pretty happy with Roodylib's behavior. If anyone has any thoughts, feel free to share.
I was only able to replicate this issue with hugolib without roodylib (and funnily enough, if one UNDOs and then tries the same command again, it gets it right the second time). Pronoun-handling in Hugo's standard library always was a little slapdash. Without remembering the specifics of everything I did, I know I tried to make things a little more consistent in Roodylib. In Roodylib, it seems it almost always applies the "it" object to the object, which seems to work for the most part.
I think I might add some code to Parse which checks the context (like whether the verb is something like "open"/"close") and chooses the "it" object based what fits, but other than that, I guess I'm already pretty happy with Roodylib's behavior. If anyone has any thoughts, feel free to share.