How To: Show Variables and Actor Fields in Dialogue Text
Posted: Sun Nov 15, 2020 10:30 pm
This post explains how to show variable values and actor field values in dialogue text.
Variables
To show variable values in dialogue text, use the [var=variable] markup tag. Example:
Actor Fields
(This also applies to Quest, Item, and Location fields.)
Use the [lua(code)] markup tag. For example, say the actor Timmy has a field named Age. You can do this:
Variables
To show variable values in dialogue text, use the [var=variable] markup tag. Example:
- Dialogue Text: "Brrr! It's only [var=CurrentTemperature] degrees out today!"
- Variable["Actor"]: The display name of the character being used as the conversation's actor.
- Variable["Conversant"]: The display name of the character being used as the conversation's conversant.
- Variable["ActorIndex"]: The index into the Actor[] list for the actor, such as "Player" for the list element Actor["Player"].
- Variable["ConversantIndex"]: The index into the Actor[] list for the conversant.
Actor Fields
(This also applies to Quest, Item, and Location fields.)
Use the [lua(code)] markup tag. For example, say the actor Timmy has a field named Age. You can do this:
- Dialogue Text: "I'm [lua(Actor["Timmy"].Age)] years old."
- Dialogue Text: "My name is [var=Conversant]. I'm [lua(Actor[Variable["ConversantIndex"]].Age)] years old."