Page 1 of 1

Load Conversation line dynamically from Server

Posted: Wed Mar 09, 2022 10:57 pm
by joshualoveridge
Hey Toni!

Hope you are well mate,
so I've built a system where im storing quest data on a webserver which im pulling in & then parsing to strings etc at runtime which all works fine.

What im looking to do is modify the conversation tree from dialogue system which we are using with a quest machine backend, essentially i want to be able to pull in those dynamic fields we pulled from the server.


So for example i could have a line like this "Hi, [USERNAME], Welcome to [Game Name]" etc etc

any ideas? :)

Re: Load Conversation line dynamically from Server

Posted: Thu Mar 10, 2022 7:53 am
by Tony Li
Hi,

Use Dialogue System variables. You can set them at runtime using DialogueLua.SetVariable():

Code: Select all

// C# code:
DialogueLua.SetVariable("USERNAME", "Joshua");
DialogueLua.SetVariable("GameName", "The Awesome Game");
  • Dialogue Text:: "Hi, [var=USERNAME], Welcome to [var=GameName]"
If you've added a Dialogue System Quest Machine Bridge component to your Dialogue Manager as described on page 7 of the Dialogue System Support manual, your dialogue text can also use Quest Machine tags such as {#counter} and {QUESTER}.

Re: Load Conversation line dynamically from Server

Posted: Fri Mar 11, 2022 5:19 pm
by joshualoveridge
Awesome and does that get called from the script field in the dialogue editor, or does it get called from just a C# script on the conversation actor?

Re: Load Conversation line dynamically from Server

Posted: Fri Mar 11, 2022 5:43 pm
by Tony Li
From a C# script. I'm assuming you'd set those variables before starting the conversation.