I have a character in bed in a bedroom. The bedroom contains several items of clothing and furniture and whatnot defined as Thing, Surface; Container; Thing, Wearable; and Decoration. Harry is supposed to get out of bed then wear the wearables. That part works.
Except…
If the command is “wear all” the game itemizes a long list of things that cannot be worn in addition to the things that can be worn.
I would like to trap the “Wear all” command and abort the process with a single, simple (“too much; be more specific”) message.
But I can’t find where the “wear” command—much less “wear all”—gets executed.
I’ve tried adding a dobjFor(Wear) block and setting a Workbench debugger break point at the if() statement, but it does not work.
dobjFor(Wear)
{
action()
{
if(gDobj == 'all')
"Boo!";
}
}
If I change that to dobjFor(Take), the break point works and I can fiddle with the code. But when it’s Wear, PutOn, or Don (the synonyms for Wear defined in the Wear VerbRule in garramar.t), the break point does not trap the action.
Here’s a complete workable testbed game, pared down to just a few items in the room to more easily isolate the problem…
#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 <a href="mailto:jerry.o.ford@gmail.com">
Jerry Ford</a>'
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' @harrysBed
""
contType = Carrier
globalParamName = 'harry'
isFixed = true
isHim = true
isInitState = true
ownsContents = true
person = 3
proper = true
;
harrysBedroom: Room
'Bedroom' 'bedroom'
"The bedroom."
;
+ harrysBed: Container 'bed;;bed'
"The bed."
dobjFor(Take)
{
action()
{
if(gDobj == 'all')
"Boo!";
}
}
;
And here’s the game outpout…
Ignore the cheeky “Yeah, right, as if…” responses; that’s just me experimenting with custom messaging. What I’m after is getting rid of the entire list of things that can’t be worn.
Jerry