Strange Attribute?

(Quest TA 5.8)

What does the "Display hyperlinks in commands" checkbox under the "Room Descriptions" tab of the game object do?

This checkbox corresponds to the Boolean attribute game.echohyperlinks (default setting is true).

I couldn't find an answer on the forums (or barely a mention). The reason I ask is that if I uncheck it (set to false), some of the object aliases in my game (that use text processor directives) fail to display properly.


 <function name="HandleCommand" parameters="command, metadata">

This part:

        shownlink = false
        if (game.echocommand) {
          if (metadata <> null and game.enablehyperlinks and game.echohyperlinks) {
            foreach (key, metadata) {
              if (EndsWith(command, key)) {
                objectname = StringDictionaryItem(metadata, key)
                object = GetObject(objectname)
                if (object <> null) {
                  msg ("")
                  msg ("&gt; " + Left(command, LengthOf(command) - LengthOf(key)) + "{object:" + object.name + "}" )
                  shownlink = true
                }
              }
            }
          }
          if (not shownlink) {
            msg ("")
            OutputTextRaw ("&gt; " + SafeXML(command))
          }
        }

https://github.com/textadventures/quest/blob/2e521f35b4e780ae440b0b43a34e20794e7c0adc/WorldModel/WorldModel/Core/CoreParser.aslx#L44


This line: OutputTextRaw ("&gt; " + SafeXML(command))

It looks like it doesn't use the text processor when that is unchecked.

You could try changing it to msg("&gt; " + SafeXML(command)), but I did not test it.


KV I don't think that should be the problem. Without hyperlinks, it's just printing the command the player typed; and that shouldn't contain text processor directives anyway.

However, I do think that "{object:" + object.name + "}" should be "{object:" + object.name + ":" + key + "}" in that code; if the player types an object's alternate alias, it should echo what they typed.


Without hyperlinks, it's just printing the command the player typed; and that shouldn't contain text processor directives anyway.

Oh, I see. With hyperlinks, it's replacing key (which is the object's name as entered by the player) with the link.

Which means your "however" seems to be spot on.

...except if the player entered the first few letters, wouldn't the link be just those first few letter?


Also, I think Dcoder had issues with the text processor stuff in an object's name (or alias), and Quest maybe got updated to handle that in 5.8? (If not, there's some modified code to handle it in his game, I think.)


I was just curious to understand what that attribute did. I was surprised that unchecking that box could break so much of my game so easily!

If I leave it checked (game.echohyperlinks = true), my aliases which contain text processor directives work fine. If unchecked, the directive's literal text will be printed out instead of the interpreted result of that directive. So I will leave it checked.


Log in to post a reply.

Support

Forums