Page 1 of 1

QuestLog.GetQuestEntry problem

Posted: Fri Nov 16, 2018 6:31 pm
by bluebuttongames
Hi there,

In my code I'm using QuestLog.GetQuestEntry for a string but I'm getting:

[lua(Variable["track_smallrabbits"])]/3 Small Rabbits killed back rather than the correct live variable string that's displayed in the quest tracker.

Any way I can get around this?

Thanks,

BB

Re: QuestLog.GetQuestEntry problem

Posted: Sat Nov 17, 2018 1:41 am
by Tony Li
Hi,

Run it through FormattedText.ParseCode. For example:

Code: Select all

string s = FormattedText.ParseCode(QuestLog.GetQuestEntry("Your Quest", 1));
The ParseCode function replaces [lua(code)] and [var=varName] tags with their runtime values.

BTW, you can simplify your entry to this:

Code: Select all

[var=track_smallrabbits]/3 Small Rabbits Killed
The shorter syntax may make it easier to identify typos.

Re: QuestLog.GetQuestEntry problem

Posted: Sun Nov 18, 2018 5:17 am
by bluebuttongames
Thanks Tony!