Overriding the SAY verb in TADS

I just want to do this. Have the player say or recite a word - a literal.

code:

VerbRule(Recite)
( ‘recite’ | ‘say’ ) singleLiteral
: ReciteAction
verbPhrase = ‘recite/reciting/say/saying (what)’

Now recite foo works perfectly but the SAY command has a mind of its own and comes back with the message - You must be more specific about whom you want to talk to.

I don’t want any of that nonsense. I just want SAY foo to be synonymous with RECITE. Please help.

from your code, I infer that you use adv3 library…

after this little library disambiguation :wink: I note that you have created a verb (Recite) whose share the vocabulary with two peculiar (and AFAICT, little used) verb (yes and no), and adv3 evidently disambiguated in favour of these verb, hence executes either yesAction or NoAction, whose “mind(s) of its (their) own” notes that there’s a Dobject instead of an Actor (note “whom” instead of “what” in the message…) resulting in your issue.

If my diagnosis is correct, the simplest (?) solution lies in putting alongside the appropriate DobjFor (Recite) in your recitals object(s), together with a pair of appropriate RemapTo of both YesAction and NoAction to ReciteAction.

Best regards from Italy,
dott. Piergiorgio.

1 Like

Did you do elsewhere
DefineLiteralAction(Recite)
?
Also, SayAction is not defined in adv3 so did you create it or are you using Lite?

John, I think that
:ReciteAction
point toward an adv3-based snippet…

Best regards from Italy,
dott. Piergiorgio.

1 Like

I did a test drive (under adv3) with the following code and it seemed to do what you want? Have you defined other verbs that might conflict with this?

DefineLiteralAction(Recite)
    execAction() {
        "You confidently belt out \"\^<<gLiteral>>.\"  ";
    }
;
VerbRule(Recite)
    ( 'recite' | 'say' ) singleLiteral : ReciteAction
    verbPhrase = 'recite/reciting (what)'
;

Transcript:

>recite foo  
You confidently belt out "Foo."                                                  

>say blarg
You confidently belt out "Blarg."

Also, note you should only give one verb/verbing pair under VerbPhrase.

2 Likes

One quick clarification. If you try to say ‘yes,’ ‘no,’ various forms of ‘bye’ or ‘hi’ (ie >say yes) it will resolve to another verb - Yes, No, Goodbye and Hello respectively. If I >say no in a room with multiple NPCs, you get the ‘be more specific’ response from your original post.

You would need to modify those verbs to no longer accept ‘say yes’ (for example). If needed, you could add more sophisticated Literal matching in your execAction to redirect actions back to Yes/No/Goodbye/Hello to keep things smooth for the player. Or, more clumsily, you could leave the verbs as is and educate the player on the differences between >say no and >say 'no'.

2 Likes