Page 1 of 1

Issue with setting conversation in c#

Posted: Thu Aug 17, 2017 6:29 am
by astroimpossible
Hi, I've come across a small issue when setting a conversation in c# for an NPC. I'm using something like:

NPC.GetComponent<ConversationTrigger>().conversation = "Example/Conversation";

This results in a "Conversation not found in database" warning. However, if I set it to a conversation not in a subfolder, e.g. just "Conversation", it works fine. So basically it's not currently working for any conversation I have in a sub folder. I have a feeling I'm missing something obvious, but coffee isn't helping my brain figure it out. Any help would be appreciated!

Re: Issue with setting conversation in c#

Posted: Thu Aug 17, 2017 10:15 am
by Tony Li
Hi!

That should work. Are you perhaps using a backslash ( \ )? If so, this will cause C# to interpret it as a special character (e.g., "\n" is a newline). Or is there a blank space somewhere in the conversation title (e.g., "Example /Conversation")? (Note the blank space at the end of "Example ".) Also, try using a literal string such as @"Example/Conversation":

Code: Select all

NPC.GetComponent<ConversationTrigger>().conversation = @"Example/Conversation";

Re: Issue with setting conversation in c#

Posted: Thu Aug 17, 2017 11:14 am
by astroimpossible
*slaps forehead* You were right, there's a space in the conversation title I was testing. Problem solved. Thanks!

Re: Issue with setting conversation in c#

Posted: Thu Aug 17, 2017 11:53 am
by Tony Li
Happy to help!