Another day, another TADS3 question: what’s the proper way to force verb agreement with an object/Thing
for message parameter substitution? Specifically in the case where the “bare” name
of the object is used, instead of aName
or theName
.
The example:
#charset "us-ascii"
#include <adv3.h>
#include <en_us.h>
startRoom: Room 'Shop'
"This is a featureless shop. "
;
alice: Actor 'shopkeeper' 'shopkeeper'
"She looks like the first shopkeeper you'd turn to in a problem. "
isHer = true
location = startRoom
;
+ keys: Thing 'keys' 'keys'
isPlural = true
desc() {
local holder, obj;
obj = self;
holder = self.getCarryingActor();
gMessageParams(obj, holder);
"{You obj/he} {is} hanging from {its holder/her} belt.\n ";
"{Your holder/her} <<name>> {is} hanging from
{its holder/her} belt.\n ";
"{Your holder/her} {you obj/he} {is} hanging from
{its holder/her} belt.\n ";
}
;
me: Actor
location = startRoom
;
versionInfo: GameID
name = 'sample'
byline = 'nobody'
authorEmail = 'nobody <foo@bar.com>'
desc = '[This space intentionally left blank]'
version = '1.0'
IFID = '12345'
;
gameMain: GameMainDef
initialPlayerChar = me
;
The only room is a shop of some sort, and the shopkeeper is carrying some keys. The problem:
>x keys
The keys are hanging from her belt.
The shopkeeper's keys is hanging from her belt.
The shopkeeper's the keys are hanging from her belt.
>
In the first phrase everything looks good: the {is}
agrees with {You obj/he}
. But in the second phrase {is}
agrees with {Your holder/her}
instead of the object. Presumably because it uses the <<>>
form name instead of the {}
parameter substitution syntax. Okay, fine. But what’s the correct message parameter substitution syntax for using just the name? In the third example the verb agreement is correct for {you obj/he}
, but that uses the object’s theName
instead of plain old name
, which is what’s needed here.
Looking at the Message Parameter Substitutions documentation there doesn’t seem to be any way to use the name
form.
To be clear: what I’m trying to work out is how to make something of the second/third form of the phrase work correctly, i.e. something like "{Your holder/her} {you obj/he} {is} hanging from {its holder/her} belt. " only without the extraneous “the” that this adds.
Clearly in this specific example it would be simple to just hardcode the strings, but I’m trying to figure out the syntax for this sort of situation in general.