Hi Eric and other adv3Lite users,
I’m trying to learn how the DEBUG command in adv3Lite works, and found a glitch in the way DEBUG DOERS display the command if it’s defined as one of the options using “|” separator in the Doer definition.
Example:
[code]#charset “us-ascii”
#include <tads.h>
#include “advlite.h”
versionInfo: GameID
name = ‘Bug Report Sample’
byline = ‘by Ming Hua’
desc = ‘Sample code for bug report about the DEBUG DOERS command of
adv3Lite.’
;
gameMain: GameMainDef
initialPlayerChar = me
;
startRoom: Room ‘Start Room’
"This is where the game starts. The only thing noticable here is a big
black lever. "
;
-
lever: Lever ‘lever; big black’
"A black stick in a slot. It can be pushed forward or pulled back. "isFixed = true
; -
me: Thing ‘you’
isFixed = true
proper = true
person = 2
contType = Carrier
ownsContents = true
;
Doer ‘push lever north|south|west|east’
execAction( cmd ) {
"You can only push the lever forward, not other directions. ";
abort;
}
;
Doer ‘push lever up’
execAction( cmd ) {
"The lever is horizontal. ";
abort;
}
;
leverTest: Test ‘lever’
[
‘x lever’,
‘pull lever’,
‘push lever’,
‘debug doers’,
‘push lever north’,
‘push lever up’
]
;[/code]
Output:
[code]>test lever
Testing sequence: “lever”.
x lever
A black stick in a slot. It can be pushed forward or pulled back.
pull lever
Done.
push lever
Done.
debug doers
Debugging options:
actions = off
doers = on
messages = off
spelling = off
push lever north
[Executing Doer; cmd = ‘south|west|east’]
You can only push the lever forward, not other directions.
push lever up
[Executing Doer; cmd = ‘push lever up’]
The lever is horizontal.[/code]
As you can see, the debug output for PUSH LEVER NORTH gives the command as “south|west|east” instead of “push lever north”.
I tried to figure this out by myself, but the actionTab code in debug.t is too advanced for me.
BTW, speaking of levers, does anyone know why the Lever class is not a subclass of Fixture?