Procedural characters?

Announcements, support questions, and discussion for the Dialogue System.
timbecile
Posts: 110
Joined: Mon Mar 12, 2018 11:00 pm

Re: Procedural characters?

Post by timbecile »

Hey Tony,

your code worked great after a bit of a tweak - had to add the Title to get the conversation to work. Posting my code for posterity...

Code: Select all

        void SetRandomConversation()
        {
            List<PixelCrushers.DialogueSystem.Conversation> conversations = DialogueManager.masterDatabase.conversations.FindAll(x => x.Title.StartsWith("Region/Town/"));
            int conversationID = UnityEngine.Random.Range(0, conversations.Count);
            GetComponent<DialogueSystemTrigger>().conversation = conversations[conversationID].Title.ToString();
        }
User avatar
Tony Li
Posts: 21070
Joined: Thu Jul 18, 2013 1:27 pm

Re: Procedural characters?

Post by Tony Li »

Thanks for sharing the updated code!
Post Reply