Duplicate messages (Adv3Lite)

Hello TADS folks

I’m trying to override the default cannot[whatever]Msg on some specific objects, but I’m finding that my custom message is being printed twice. Does anyone know what’s wrong here?

e.g. - here’s a minimal game with a table, on which I want to override the cannotPutUnderMsg. Trying to put the ball under the table prints the custom message twice:

versionInfo: GameID
    IFID = '43139319-d312-45e0-a61b-3a793e4ffa4a'
    name = 'PlaySpace'
    byline = 'by Your Name'
    htmlByline = 'by <a href="mailto:your-email@host.com">Your Name</a>'
    version = '1'
    authorEmail = 'Your Name <your-email@host.com>'
    desc = 'Put a brief "blurb" about your game here'
    htmlDesc = 'Put a brief "blurb" about your game here'
;
gameMain: GameMainDef
    initialPlayerChar = me
;
startroom: Room 'The Starting Location'
    "Add your description here. "
;
+ me: Thing 'you'   
    isFixed = true       
    person = 2  
    contType = Carrier    
;
++ ball: Thing 'ball'
;
+ table: Surface 'table'
    cannotPutUnderMsg = "Ancient superstition inhibits you from putting anything under the table. "
;

…and the same effect with cannotPutBehindMsg etc.

You should use single-quotes:

    cannotPutUnderMsg = 'Ancient superstition inhibits you from putting anything under the table. '

The reason you’re seeing the message twice is (a) the PutUnder verify() function is being called more than once during disambiguation, and (b) by using double-quotes, the parser is printing the message instead of returning the string.

1 Like

I saw in the other thread that this is your first TADS project, so a couple of other pointers related to the above:

If the property is named xxxMsg, that generally indicates it should be a single-quoted string. If it’s named xxxDesc, that generally indicates it should be a double-quoted string. (There are some exceptions to this, though, so read the docs carefully.)

1 Like

Thanks Jim. Such a simple solution! I think I’ve reached my (very limited) saturation point with the docs for now so it’ll be learning by doing for a while…which will doubtless result in more silly questions from me.

2 Likes