Arag-e wrote:
Setting vocabLikelihood like the example shows does what I want for the singular vocab words ("x apple" returns only apples1's desc), but the plural ones refer to both, even though I’d like for mom’s apples to not be referred to unless the player specifically specifies them. Is there some way to do this, or will the parser always give priority to all objects who fit a command in plural?
The parser will always return all objects that match a plural. The simplest approach is to not actually mark the vocabulary as plural:
Code:
Dad: Actor 'Dad' 'Dad'
"It's dad"
;
+ apples1: Possession 'apple/fruit/apples/fruits' 'apples'
"They're dad's apples"
vocabLikelihood = 2
isPlural = true
;
Mom: Actor 'mom' 'Mom'
"It's mom"
;
+ apples2: Possession 'apple/fruit/apples/fruits' 'apples'
"They're mom's apples"
vocabLikelihood = 1
isPlural = true
dobjFor(Default) { verify() { nonObvious; } }
;
Which works in this simplistic case, but may not if you actually want the plural-matching behavior to find all matching objects except for Mom's - if brother and sister had apples as well, say.
Another option is to set up the vocabulary for Mom's apples like this:
Code:
apples2: Possession 'mom\'s apple/fruit*apples fruits' 'apples'
"They're mom's apples"
isPlural = true
weakTokens = ['apple', 'fruit', 'apples', 'fruits']
;
Which is sort of backwards but does the job, at the cost of "x mom's" referring to the apples (since the possessive adjective is the only strong vocabWord in the list.)