Harry and Max are in the kitchen. Harry takes a fork then gives it to Max. I want to intercept the action and provide my own text rather than accept the system-generated “Max does not respond,” without having to implement a GiveTopic.
So, I have a Doer that works as desired when the command is entered as give fork to max but not when the command is give max the fork even though both forms equate to the GiveTo command, according to the action reference table in the Adv3Lite Library Manual.
Here’s a transcript…
…and the code that produced it…
#charset "us-ascii"
#include <tads.h>
#include "advlite.h"
versionInfo: GameID
IFID = '445C38A3-AD1B-4729-957A-F584600DE5C1'
name = 'test'
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 = 'Testing give to.'
htmlDesc = 'Testing give to.'
;
gameMain: GameMainDef
initialPlayerChar = harry
paraBrksBtwnSubcontents = nil
;
kitchen: Room 'Kitchen' 'kitchen'
"The kitchen <.p>"
;
+ fork: Fork 'fork;;silverware'
"A row of forks, tines of silver, handles of carved ivory, joined
knives, forks and plates on the table next to the chafing dishes.
<.p>"
isListed = nil
dobjFor(Drop)
{
verify()
{
if(Fork.isIn(harry))
abort;
}
}
;
class Fork: Thing 'fork'
"The fork tines were silver, the handled carved ivory. <.p>"
;
//*********** Max Character *********************************
harrysSonMax: Actor 'Max;teenager teen age ager;son;him' @kitchen
""
globalParamName = 'max'
person = 3
bulkCapacity = 5000
attentionSpan = 3
;
// harry, main character
harry: Actor 'Harry;;man self;him' @kitchen
""
globalParamName = 'harry'
person = 3
bulkCapacity = 5000
;
Doer 'give Thing to Actor'
execAction(cmd)
{
"text from 'give Thing to Actor' Doer";
}
;
Doer 'give Actor Thing'
execAction(cmd)
{
"text from 'give Actor Thing' Doer";
}
;
Any insights appreciated.
Jerry