unexpected results with adv3lite BMsg texxt

I want to modify the text displayed when Harry attacks something with something inappropriate.

But the cannot attack with BMsg is not behaving as expected.

Here’s the unmodified message text defined in thing.t

BMsg(cannot attack with, '{I} {can\'t} attack anything with {that iobj}. ')

Here’s what I see when try to use the cell phone as a weapon…

The code in thing.t seems to suggest that {that iobj} in the text string should produce cannot attack anything with the cell phone.

Instead, I get cannot attack anything with that.

I wanted to modify the text to say Harry can’t attack the medallion with the cell phone.

After some experimentation, I find that this gets me what I want…

Msg(cannot attack with, '{The subj iobj} was not suitable as a weapon against {the subj dobj}.')
Here’s how it looks in play…

Jerry

The BMsg is doing exactly what it’s meant to here. {that iobj} is meant to produce ‘that’ (if iobj is singular) or ‘those’ (if iobj is plural). That’s the point of calling it ‘{that iobj}’ rather than ‘{the iobj}’. I can’t see anything in thing.t that suggests otherwise, and the list of message substitution parameters is in any case given in the ‘Messages’ section of the Manual, where you’ll find that that {that iobj} is doing just what it’s meant to!

That will give you what you want, but strictly speaking it should be:

Msg(cannot attack with, '{The subj iobj} was not suitable as a weapon against {the dobj}. ')

This is because the ‘subj’ in {the subj dobj} (or {the subj iobj}) means the subjective case (the object in question is being marked as the subject of the sentence). Following a preposition like ‘against’ you want the objective case, so you don’t need (or want) the ‘subj’ in ‘against {the subj dobj}.’ In this case you won’t see any difference, of course, since English nouns don’t decline, but in a different context in might make a difference, since if you had written “{The subj iobj} {is} not a suitable as a weapon against {the subj dobj} but {is} too feeble for such use”, the second {is} would agree with the dobj rather than the iobj, with the risk of generating sentences like, “The bananas were not suitable as a weapon against the medallion but was too feeble for such use”, which is ungrammatical.

Moral of the story: only use ‘subj’ if you mean to mark something as the subject of a verb to follow. That’s what subj is for.

But adv3Lite is not doing anything wrong here; {that} means ‘that’ and that’s what it was giving you! :slight_smile:

Well, okay, you got me there, as a technical writer, I should know to RTFM more carefully before posting. :slight_smile:

So, I’ve R’d the FM, and I’m still having trouble.

The table of message parameters in the manual says {hers obj} should give the possessive pronoun appropriate to obj. When I try it for the obj harry, on which the isHim property is true, I get its not his.

Msg(jump, 'The urge to jump was followed quickly by the rhetorical question in {hers obj} mind, <i>how high?</>'),
…produces…

This appears to be the case with several of the pronouns—

[code] Msg(jump, ‘The urge to jump was followed quickly by the rhetorical
question in {hers obj} {he obj} {him obj} {her obj} mind, how high?</>’),

[/code]

…begets…

Jerry

Actually {hers obj} would give the possessive noun ‘hers’ not the possessive pronoun ‘her’ (as it says in the manual) :wink:.

But what does obj refer to here? Unless obj somehow refers to the actor doing the jumping, you can’t expect any of these message parameter substitutions to match the actor’s gender.

I think you’ll find you needed to use actor wherever you wrote obj, to make the message actually refer to the actor doing the jumping.

But if all you’re actually after is the possessive pronoun for the actor doing the jumping, it’s simpler just to use {my}.

Still no joy.

{hers Actor} produces its
{his Actor} produces its
{my} produces himself

Msg(jump, 'The urge to jump was followed quickly by the rhetorical question in {I}\'s {hers Actor} {his Actor} {my} mind, <i>how high?</>'),

The only one that works is {I}'s which produces the formal name, limiting it to once per message (unless Harry put Harry’s hand in Harry’s pocket is acceptable).

Hmmm, progress of sorts.

Lower case a in actor makes a difference and produces a correct pronoun for one of the tags (the his I’m looking for). But not all of them.

Where…

{hers Actor} produces its
{his Actor} produces its

…lowering A to a results in…

{hers actor} produces himself
{his actor} produces his

Msg(jump, 'The urge to jump was followed quickly by the rhetorical question in {I}\'s {hers actor} {his actor} {my} mind, <i>how high?</>'),

That’s because you wrote Actor and not actor, and TADS is case-sensitive.

With this:


CustomMessages
    messages = [
        Msg(jump, 'The urge to jump was followed quickly by the rhetorical
            question in {I}\'s {hers actor} {his actor} {my} mind, <i>how
            high?</i>')
    ]
;

I get this:

If you just wrote this:

CustomMessages
    messages = [
        Msg(jump, 'The urge to jump was followed quickly by the rhetorical
            question in {my} mind, <i>how high?</i>')
    ]
;

You’d get this:

Well, hmmm, that was unexpected.

These tags seem to be dependent on each other within a message string.

Msg(jump, 'The urge to jump was followed quickly by the rhetorical question in {my} mind, <i>how high?</>'),

…produces the correct result…

…while combining the {my} tag with a {his actor} tag does not…

Msg(jump, 'The urge to jump was followed quickly by the rhetorical question in {his actor} {my} mind, <i>how high?</>'),

The presence of the {his actor} tag—with actor in it—causes the {my} tag to produce himself.

But when the {my} tag stands alone in the string, it produces Harry’s name.

Jerry

We obviously posted at the same time, so our messages crossed.

You’ll find {my} only gets turned into ‘himself’ if there’s a previous {I} in the message parameter string. I agree this shouldn’t happen, so for the next release I’ll make yet another attempt to curb the library’s gross overeagerness to use reflexive pronouns! :frowning:

In the meantime, if you need to, you should be able to cajole adv3Lite away from its excessive love of possessives by inserting a {dummy} between {I} and {me}, e.g.:

CustomMessages
    messages = [
        Msg(jump, '{I} {think} the urge to jump was followed quickly by the
            rhetorical question in {dummy} {my} mind, <i>how high?</i>')
    ]
;

(This works because the library thinks that the {dummy} has stopped {I} being the subject of the sentence, so that it no longer feels an irresistible urge to turn any subsequent allusion to it into a reflexive).

Once again our posts nearly crossed. What you’re seeing is a side-effect of the same problem. The algorithm that looks for the need to use reflexive pronouns is being over-eager; if it sees a subject mentioned once it wants to turn any subsequent mention of it into a reflexive pronoun, because it rather simple-mindedly worries that sentences will otherwise turn out like “Harry doesn’t want to hit Harry.”