Quest 6 - Question/Request - Use of text processor parameters in room descriptions

I would like to have a room description have a couple variations depending on the POV character's gender. This would mean using the text processor's {pv:}, {pa:}, etc. in some occurences.

In this current version of Q6 (0.8), these functions require the use of a msg function to define the parameters it will use (as I understand it).

The issue is that a room's desc must always be a string, so I must use a workaround, such as writing descas a function returning a string (which is slightly more cumbersome as I must concatenate player.pronouns.xxxx), or using the afterEnterproperty.

My question/request is (or rather are):

  • Is there a way to use the text processors conjugation functions without a parameter, or to define the item by its name instead of a parameter, or even to default to playeror char if there is no itemproperty
  • Is there a possibility in a future version to make the descproperty a "printOrRun" function, like the examine property of items

One way to do it in the current version would be to pass the string through processText before returning it.

  desc:function() {
    let s = ''
    // ...
    return processText(s, params)
  }

The reason it wants a string returned is so the text processor can be used, together with settings.roomTemplate. If the parameters had player built in, would that do what you want? Looking at the code, some directives do that already, so it would be good if the all did.


Log in to post a reply.

Support

Forums