(assuming you mean)

Hugo programming discussion. http://www.generalcoffee.com/hugo
Hugo By Example: http://hugo.gerynarsabode.org/index.php?title=Main_Page
Roody Yogurt's Hugo Blog: http://notdeadhugo.blogspot.com

Moderators: Ice Cream Jonsey, AArdvark

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

(assuming you mean)

Post by Ice Cream Jonsey » Sun Sep 01, 2019 5:12 pm

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?
the dark and gritty...Ice Cream Jonsey!

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

Re: (assuming you mean)

Post by Ice Cream Jonsey » Sun Sep 01, 2019 5:13 pm

I solved it by giving the jumpsuit a pronoun of "it" but still Weird.
the dark and gritty...Ice Cream Jonsey!

User avatar
Tdarcos
Posts: 5519
Joined: Fri May 16, 2008 9:25 am
Location: Arlington, Virginia
Contact:

Re: (assuming you mean)

Post by Tdarcos » Mon Sep 02, 2019 8:43 pm

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.
"I might only have one match / But I can make an explosion."
- Rachel Platten, Fight Song

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

Re: (assuming you mean)

Post by Ice Cream Jonsey » Tue Sep 03, 2019 8:22 pm

Thanks, pal. I'll give that a shot.
the dark and gritty...Ice Cream Jonsey!

Roody_Yogurt
Posts: 1994
Joined: Mon Apr 29, 2002 6:23 pm
Location: Milwaukee

Re: (assuming you mean)

Post by Roody_Yogurt » Sat Sep 07, 2019 12:40 pm

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.

Post Reply