Load Conversation line dynamically from Server

Announcements, support questions, and discussion for Quest Machine.
Post Reply
joshualoveridge
Posts: 19
Joined: Tue Jan 01, 2019 12:53 am

Load Conversation line dynamically from Server

Post 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? :)
User avatar
Tony Li
Posts: 22104
Joined: Thu Jul 18, 2013 1:27 pm

Re: Load Conversation line dynamically from Server

Post 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}.
joshualoveridge
Posts: 19
Joined: Tue Jan 01, 2019 12:53 am

Re: Load Conversation line dynamically from Server

Post 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?
User avatar
Tony Li
Posts: 22104
Joined: Thu Jul 18, 2013 1:27 pm

Re: Load Conversation line dynamically from Server

Post by Tony Li »

From a C# script. I'm assuming you'd set those variables before starting the conversation.
Post Reply