Jump to content

Suggestion: Expand functionality of convo dialog formatting


RageLeague

Recommended Posts

Right now, variables defined in encounter.scratch are only substituted in a boolean expression. For example:

:Loc{
  DIALOG_1 = [[
    * {expression?Yay it works!}
  ]],
  DIALOG_2 = [[
    * Value of expression: {expression}.
  ]],
  DIALOG_3 = [[
    {non_bool?
      * non_bool is non-nil
    }
    {not non_bool?
      * non_bool is nil
    }
  ]],
  DIALOG_4 = [[
    {non_bool?
      * Truthy
      |
      * Falsie
    }
  ]],
}
:Fn(function(cxt)
  cxt.enc.scratch.expression = true
  cxt.quest.param.non_bool = cxt:GetAgent() -- a table. A truthy value, but is not exactly "true"
  cxt:Dialog("DIALOG_1") -- formatter works
  cxt:Dialog("DIALOG_2") -- formatter doesn't replace {expression}
  cxt:Dialog("DIALOG_3") -- For some reason, outputs nothing
  cxt:Dialog("DIALOG_4") -- Outputs Falsie, despite non_bool being truthy
end)

Maybe it can allow the second expression to work.

Also, there's some other bugs regarding non-boolean values' interaction with the formatter. See DIALOG_3 and DIALOG_4.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

Please be aware that the content of this thread may be outdated and no longer applicable.

×
×
  • Create New...