Page 1 of 1

(assuming you mean)

Posted: Sun Sep 01, 2019 5:12 pm
by Ice Cream Jonsey
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?

Re: (assuming you mean)

Posted: Sun Sep 01, 2019 5:13 pm
by Ice Cream Jonsey
I solved it by giving the jumpsuit a pronoun of "it" but still Weird.

Re: (assuming you mean)

Posted: Mon Sep 02, 2019 8:43 pm
by Tdarcos
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?
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.

Re: (assuming you mean)

Posted: Tue Sep 03, 2019 8:22 pm
by Ice Cream Jonsey
Thanks, pal. I'll give that a shot.

Re: (assuming you mean)

Posted: Sat Sep 07, 2019 12:40 pm
by Roody_Yogurt
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":
>PUT POPCORN IN MICROWAVE
You put the popcorn in the microwave.

>CLOSE IT
You would want the "it" obect set to the microwave, right? But imagine some kind of Zork Zero cauldron.
>PUT THING IN CAULDRON
You throw the thing into the cauldron.

>EXAMINE IT
The cauldron bubbles with greater intensity now.
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.

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?
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)
}
}
}
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.

Re: (assuming you mean)

Posted: Mon Oct 21, 2019 2:51 pm
by Roody_Yogurt
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.