Page 2 of 2

Re: Procedural characters?

Posted: Thu Feb 25, 2021 4:40 pm
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();
        }

Re: Procedural characters?

Posted: Thu Feb 25, 2021 5:16 pm
by Tony Li
Thanks for sharing the updated code!