I’m experimenting with writing an IF game in TADS3, but I keep trying to do things that apparently the programmers weren’t intending for me to try… I usually reserve that talent for playing IF games… but that’s neither here nor there…
The game I am making is intended to be very dynamic with randomly generated NPCs. I’ve got most of the elements of it figured out… the only problems are noun-referencing the character’s components. There are other things I’d like to do, but I’ve pretty much come to the conclusion that they’re impossible
At this point, all I really want to do is to make it so that “betty nose” (or whatever their name is) works the same as “betty’s nose” and “her nose” without making the automated response so bizarre. (see below for details)
This is the basic code as it would probably normally appear in TADS when crazy people like me aren’t over-thinking things…
[spoiler][code]
class Nose: Component ‘nose’ ‘nose’
desc = "This is the description for {your/his} nose. "
isProperName=true
;
me: Actor
location = dormRoom
;
- mynose: Nose ‘(my your) nose’ ‘your nose’
;
her: Person ‘(her/Betty)’ ‘Betty’
location = dormRoom
; - hernose: Nose ‘(her/Betty/Betty’s) nose’ ‘your nose’;
[/code][/spoiler]
Note: The “isProperName” is there because I couldn’t find another way to keep the parser from asking (i.e. when I type LOOK NOSE) “Which nose do you mean, the Betty’s nose, or the your nose?”
But what I’d really like to do is have the class handle every single thing it can. I’m almost there:
[spoiler][code]
class Nose: Component ‘nose’ ‘<<location.globalParamName>> nose’
desc = "This is the description for {your/his} nose. "
isProperName = true
;
her: Person ‘(her/Betty)’ ‘Betty’
location = dormRoom
globalParamName = ‘Betty’s’
;
- hernose: Nose;
[/code][/spoiler]
I initially tried to set a variable in Betty (noun = ‘Betty’s’) and referenced with <<location.noun>> but for some reason it would say “Which nose do you mean, Betty’s,her,Betty nose, or your nose?”.
I also tried using ‘(<<location.variable>>) nose’ in the vocabWords section, to add weak tokens… but I’d get an error at runtime: “nil object reference” (check the spoiler for the Stack error, if you’re curious).
Nose.vocabWords() + 0x12
Nose.inheritVocab(mynose, obj#238d (Vector) [mynose,Nose]) + 0x2A
mynose.inheritVocab(mynose, obj#238d (Vector) [mynose,Nose]) + 0x46
mynose.initializeVocab() + 0x15
func#361e1(mynose) + 0xE
forEachInstance(VocabObject, function#000361e1) + 0x18
adv3LibPreinit.execute() + 0x44
adv3LibPreinit._execute() + 0x51
func#1a9f(adv3LibPreinit) + 0xE
forEachInstance(PreinitObject, function#00001a9f) + 0x18
PreinitObject.classExec() + 0x38
_preinit() + 0x27
initAfterLoad() + 0x25
_mainCommon(['debug\\Weremechan.t3'], nil) + 0x10
_main(['debug\\Weremechan.t3']) + 0x12
Any suggestions? Or should I just give this up?