Some of my coin classes don't behave and I can't figure out what's
different about those that do.
Example:
You see fifteen coins (three marks, three dollars, three pennies, three
crowns, and three
zorkmids) here.
]get coin
Which coin do you mean, a crown, a dollar, a zorkmid, a penny, or a mark?
]penny
Taken.
That's what I wanted. BUT:
]get coin
Which coin do you mean, a crown, a dollar, a zorkmid, a penny, or a mark?
]dollar
dollar: Taken.
dollar: Taken.
dollar: Taken.
The zorkmids behave like the dollars, too.
The code is a crude dumbing-down of the coins from sample.t:
class Coin: Thing
vocabWords = 'coin*coins'
listWith = [coinGroup]
collectiveGroup = coinCollective
;
coinGroup: ListGroupParen
showGroupCountName(lst)
{
"<<spellIntBelowExt(lst.length(), 100, 0, DigitFormatGroupSep)>>
coins";
}
compareGroupItems(a, b) { return b.coinValue - a.coinValue; }
;
coinCollective: ItemizingCollectiveGroup '*coins' 'coins'
;
class Penny: Coin 'penny*pennies' 'penny'
isEquivalent = true
coinValue = 9
;
class Mark: Coin 'mark*marks' 'mark'
isEquivalent = true
coinValue = 40
;
class Crown: Coin 'crown*crowns' 'crown'
isEquivalent = true
coinValue = 5
;
class Dollar: Coin 'dollar*dollars' 'dollar'
isEquivalent = true
coinValue = 10
;
class Zorkmid: Coin 'zorkmid*zorkmids' 'zorkmid'
isEquivalent = true
coinValue = 1
;
I'm confused, to say the least...
Normal word truncation length is 6. That's probably why the coins with
longer names are behaving differently. There was a bug in some earlier
versions of TADS 3 (I believe 3.0.10 to 3.0.12 had this issue) that
resulted in nouns being parsed plurally when they were as long as the
truncation length. http://www.tads.org/t3doc/lib/adv3/changes.htm#3013
. What release of TADS 3 are you using?
> Normal word truncation length is 6. That's probably why the coins with
> longer names are behaving differently. There was a bug in some earlier
> versions of TADS 3 (I believe 3.0.10 to 3.0.12 had this issue) that
> resulted in nouns being parsed plurally when they were as long as the
> truncation length. http://www.tads.org/t3doc/lib/adv3/changes.htm#3013
> . What release of TADS 3 are you using?
3.0.16!
My farthings weren't working either. Five letters or less, and it's
fine...
OK, I've just tried it in 3.0.16. It seems to be a surviving bug.
It is related to truncation length, so until someone works out a
proper fix, you can get around it by extending or disabling the
truncation length: put
parserTruncationLength = some number bigger than 6
or parserTruncationLength = nil
in your gameMain.
Oops. It's parserTruncLength, not parserTruncationLength. Sorry.
Thanks for the help!