Harry is at Fisherman’s Wharf in San Francisco. There are a couple of historic museum ships tied up to the pier. I want to enter walk to (either of the two ships) and have the game window display appropriate text (“Harry walked out onto the pier and boarded the ship of choice…”).
Fisherman’s Wharf is defined as a Room, and the two ships are defined as Booth, Fixture objects.
I cannot figure out how to trap the walk command. No matter what I try, I always get this…
I want my text in place of the was right there boilerplate, and I want to magically transport Harry into the museum as a result of the walk command. Essentially, I want to implement the walk command the same way I implemented the board command (board streetcar puts Harry into a streetcar, which is also a Booth, Fixture object and for which I created a new verb Board).
I have tried dobjFor(Walk) with my substitute code in the action() method; I’ve tried remapping walk to enter, go and go to, I’ve tried creating new verbs Walk and WalkTo…
VerbRule(WalkTo)
'walk to' multiDobj
: VerbProduction
action = WalkTo
verPhrase = 'walk/walking'
missingQ = 'walk where'
;
DefineTAction(WalkTo)
;
…and I’ve tried using a Doer.
[code]Doer ‘walk to USS Pampanito | Jeremiah O'Brien’
strict = true
exec(curCmd)
{
if(curCmd.dobj.name == 'USS Pampanito')
{
"Boo!";
}
}
execAction(c)
{
if(c.dobj.name == 'USS Pampanito')
{
"Boo!";
}
}
where = [fishermansWharf]
;
[/code]
Nothing works. I am unable to figure out how to trap walk using breakpoints in the code. I’ve grepped the entire lite library for walk (a single hit, in a comment block in action.t or actions.t, forget exactly, but no matter, walk is not defined anywhere else that I can find.
Obviously, TADS knows about walk—see transcript excerpt above. But how can I intercept it?
Jerry