trouble display variable in Quest text

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
User avatar
Strook
Posts: 70
Joined: Fri Nov 08, 2019 10:51 am

trouble display variable in Quest text

Post by Strook »

Hello! Im trying to do something pretty simple, but im not really sure why it fails:

I cannot display variables in the Quest text using the [var=variableName] syntax. I doesnt work for me in the Quest description and entries, but it works fine everywhere else!

here is whats showing :
Image

Image

Thank you !

PS: I had to blur some text for reasons, but there is not special code or anything going on there :oops:
User avatar
Tony Li
Posts: 22049
Joined: Thu Jul 18, 2013 1:27 pm

Re: trouble display variable in Quest text

Post by Tony Li »

Hi,

Can you try backing up your project and updating to the latest version of the Dialogue System?
User avatar
Strook
Posts: 70
Joined: Fri Nov 08, 2019 10:51 am

Re: trouble display variable in Quest text

Post by Strook »

Will do that!
Currently working on ->Squeakross: Home Squeak Home<- Using Dialogue System Save System and other features.
Previous game made with Dialogue system ->The Spirit and The mouse<-
User avatar
Strook
Posts: 70
Joined: Fri Nov 08, 2019 10:51 am

Re: trouble display variable in Quest text

Post by Strook »

Hello! I updated and the issue persists...but it might be because im doing something wrong, maybe you can help me!

The quest UI is custom, and I fetch the quest text (description, entries, etc) manually, could it be that when I do it this way :

Code: Select all

MyTextMeshProObject.text = QuestLog.GetQuestDescription(questName);
i only get the "raw" string ?


Thanks!
Currently working on ->Squeakross: Home Squeak Home<- Using Dialogue System Save System and other features.
Previous game made with Dialogue system ->The Spirit and The mouse<-
User avatar
Tony Li
Posts: 22049
Joined: Thu Jul 18, 2013 1:27 pm

Re: trouble display variable in Quest text

Post by Tony Li »

Hi,

Code: Select all

MyTextMeshProObject.text = FormattedText.ParseCode(QuestLog.GetQuestDescription(questName));
User avatar
Strook
Posts: 70
Joined: Fri Nov 08, 2019 10:51 am

Re: trouble display variable in Quest text

Post by Strook »

Exactly what i needed, thanks a lot!
Currently working on ->Squeakross: Home Squeak Home<- Using Dialogue System Save System and other features.
Previous game made with Dialogue system ->The Spirit and The mouse<-
User avatar
Strook
Posts: 70
Joined: Fri Nov 08, 2019 10:51 am

Re: trouble display variable in Quest text

Post by Strook »

I have another question :oops:

I managed to get the variable properly, but if my line is something like

Code: Select all

Hello, [em3]my variable is [var=test][/em3]
FormattedText.ParseCode return "Hello, [em3]my variable is XXX[/em3]"

What I would like, would be the result string to be something like "Hello, <color=#ffc000e9>my variable is XXX</color>"
(Basically, what a standard subtitle would be doing, so Textmeshpro can apply the emphasis settings)

How would you get the variable, and the emphasis ?
Currently working on ->Squeakross: Home Squeak Home<- Using Dialogue System Save System and other features.
Previous game made with Dialogue system ->The Spirit and The mouse<-
User avatar
Tony Li
Posts: 22049
Joined: Thu Jul 18, 2013 1:27 pm

Re: trouble display variable in Quest text

Post by Tony Li »

Hi,

Use FormattedText.Parse():

Code: Select all

MyTextMeshProObject.text = FormattedText.Parse(QuestLog.GetQuestDescription(questName)).text;
User avatar
Strook
Posts: 70
Joined: Fri Nov 08, 2019 10:51 am

Re: trouble display variable in Quest text

Post by Strook »

oh i feel dumb, I tried FormattedText.Parse, but was not sure what to do with it after... :roll:

Thanks a lot!
Currently working on ->Squeakross: Home Squeak Home<- Using Dialogue System Save System and other features.
Previous game made with Dialogue system ->The Spirit and The mouse<-
User avatar
Tony Li
Posts: 22049
Joined: Thu Jul 18, 2013 1:27 pm

Re: trouble display variable in Quest text

Post by Tony Li »

Glad to help!
Post Reply