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.
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":
[quote]>PUT POPCORN IN MICROWAVE
You put the popcorn in the microwave.
>CLOSE IT[/quote]
You would want the "it" obect set to the microwave, right? But imagine some kind of Zork Zero cauldron.
[quote]>PUT THING IN CAULDRON
You throw the thing into the cauldron.
>EXAMINE IT
The cauldron bubbles with greater intensity now.[/quote]
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?
[quote]
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)
}
}
}
[/quote]
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.