I’m having trouble customizing the unmatched noun message using Adv3Lite.
When my custom message text is defined as…
[code] Msg(unmatched noun, '{I} muttered, as it dawned
on him that he {see} no {2} {here}. ')
[/code]
…it works fine.
In the following game play, there is a dresser in the bedroom but the top drawer has not been implemented yet. When I try to open the non-existent drawer, I get the message I am expecting…
But if I change the comma that follows “muttered” to a period, I get a nil pointer exception, with the debugger pointing to the last line in the following snippet from english.t (the local idx = ctx.subj.plural line)…
[code]conjugate(ctx, params)
{
/* get the list of forms for the verb */
local toks = englishMessageParams.verbTab[params[1]];
if (toks == nil)
return nil;
/*
* get the present tense index: third-person singular has the second
* slot, all other forms have the first slot
*/
local idx = ctx.subj.plural || ctx.subj.person != 3 ? 1 : 2;
[/code]
Yes, I understand, changing the comma to a period in my example doesn’t make grammatical sense, but it illustrates the nil pointer. What I’m actually trying to achieve is a two-sentence message.
Here’s the full game…
[code]#charset “us-ascii”
#include <tads.h>
#include “advlite.h”
versionInfo: GameID
IFID = ‘47ca87f1-2d0e-4b54-a776-2bc128e30927’
name = ‘TADS 3 Lite Test Bed’
byline = ‘by Jerry Ford’
htmlByline = ‘by
Jerry Ford’
version = ‘1’
authorEmail = ‘Jerry Ford jerry.o.ford@gmail.com’
desc = ‘Test bed for experimenting with TADS 3 Lite.’
htmlDesc = ‘Test bed for experimenting with TADS 3 Lite.’
;
gameMain: GameMainDef
initialPlayerChar = harry
usePastTense = true
;
// harry, main character
harry: Actor ‘Harry;;man self’ @harrysBedroom
“”
contType = Carrier
globalParamName = ‘harry’
isFixed = true
isHim = true
isInitState = true
ownsContents = true
person = 3
proper = true
;
harrysBedroom: Room
‘Bedroom’ ‘bedroom’
“In the bedroom was a plain brown dresser.”
bedroomMentioned = true
;
-
bedroomDresser: Fixture ‘dresser’
"A small brown dresser with three drawers, top, middle, and bottom, stood against the
south wall<>, opposite the foot of the bed. The dresser was plainly built,
with neither filigree nor ornamental hardware. Just stainless steel
pulls centered in plain wood drawer faces<>. "bedroomDresserMentioned = harrysBedroom.bedroomMentioned
;
CustomMessages
messages =
[
Msg(unmatched noun, '{I} muttered, as it dawned
on him that he {see} no {2} {here}. ')
]
;
[/code]