Long-winded, inessential intro
With Comp nearly closed, I became charged with motivation to re-energize my TADS3 homeschooling. I’ve got a small training game I was using to get my hands around the syntax and development tools. I’m going to shed it in a few days (what remains is pushing the NPC dialogue into a better state) to start work on what I hope will be a 2023 Comp entry, best laid plans amirite? Sidebar, the documentation suite for TADS is just phenomenal. I have most of them open on my desktop and its been rare I can’t find an answer I need, or at least get me close enough that I can trial and error the last mile. I’m not a coding novice by a long shot, so I’ve actually been more impressed than daunted with the power and breadth of TADS.
My development environment is lightweight linux: GVim editor, t3Make and frobtads execution. I have the workbench on a windows machine but don’t use it so much. The debugger is the probably the piece I miss most, and will likely power it up if you guys leave me hanging! :]
My challenge: I was trying to implement an alternate “Hello” mechanism to mirror military radio protocol (what? you don’t know me!). The form is “[NPC], this is [player]” which was formally close to “[NPC], hello” that it seemed worth a try. I also wanted to set a variable based on the literal string the player used to identify themselves. The intent was something like this:
'>H43, this is U71
“This is H43, go ahead U71”
and also this
'>this is U71
“This is H43, go ahead U71”
Given how successful I’d been with mix-in classes until now, my first FAILED attempt was this:
class ThisIsAction : LiteralActionBase, HelloAction
execAction() {
inherited;
local cs = getLiteral();
// mainReport('...' + cs + '...'); // debug statement
if (cs == 'U71') gReveal('caller'); // unlock dialogue if PC correctly id's themself
me.makeCallSign(cs); // sets ID in actor
gIssuingActor.sayHello(gActor);
}
;
VerbRule(ThisIs)
'this' 'is' singleLiteral : ThisIsAction
verbPhrase = 'this is (what)'
;
This doesn’t work. Playing around with combinations of inherited or not, was never able to get the Literal value extracted correctly, it was always blank.
This, on the other hand is closer:
class ThisIsAction : LiteralAction
doActionMain() {
inherited;
local cs = getLiteral();
// mainReport('...' + cs + '...'); // debug statement
if (cs == 'U71') gReveal('caller'); // unlock dialogue if PC correctly id's themself
me.makeCallSign(cs); // sets ID in actor
gIssuingActor.sayHello(gActor);
}
;
VerbRule(ThisIs)
'this' 'is' singleLiteral : ThisIsAction
verbPhrase = 'this is (what)'
;
…but still is not quite there.
'>H43, this is U71
“H43, this is uh, a friend, over” you say. // This is the game saying “you don’t know who to claim to be”
// The literal is still not found.
and this is closer but also bad
'>this is U71
You can’t do that. “This is H43, go ahead U71” // works correctly, despite the error message! which I don’t know where it comes from or how to suppress.
Thanks in advance for any pointers that can forestall me having to power up my windows debugger.
You have no idea of the deluge of questions coming, now that I’ve found this board…