How to utilize ChatMapperConverter class in my scripts?

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
edassis
Posts: 4
Joined: Sun Oct 02, 2022 5:42 pm

How to utilize ChatMapperConverter class in my scripts?

Post by edassis »

I'm trying to make a custom importer that gets dialogue entries at runtime using ChatMapper xml format. I want to do something in these lines:

Code: Select all

var chatMapperConverter = new ChatMapperConverter.OnEnable();
var myPrefs = new Prefs();
myPrefs.outputFolder = "myOutputFolder";
chatMapperConverter.prefs = myPrefs;
chatMapperConverter.ConvertChatMapperProject("myXMLFile");
But the following problems are stopping me:

- I can't access ChatMapperConverter class, it's giving me the error: "CS0246 The type or namespace name 'ChatMa' could not be found (are you missing a using directive or an assembly reference?)". And I can't figure out how to use this class in the main assembly. How shold I procide?

- How can I set the prefs manually from script (necessary on ChatMapperConverter.ConvertChatMapperProject() method)? The ChatMapperConverter.prefs property it's protected.


To give you more context:

I working on a project that one of the requisites is to allow dialogue changes without rebuilding the executable. The purpose is to use the ChatMapper.xml as my questions database, this way some teacher can make adjusts on it without touching Unity.


Any help will be much appreciated. Thanks!

---
P.S: I'm new on Unity/C# :).
User avatar
Tony Li
Posts: 21965
Joined: Thu Jul 18, 2013 1:27 pm

Re: How to utilize ChatMapperConverter class in my scripts?

Post by Tony Li »

Hi,

You can use these instructions to import Chat Mapper XML at runtime.
edassis
Posts: 4
Joined: Sun Oct 02, 2022 5:42 pm

Re: How to utilize ChatMapperConverter class in my scripts?

Post by edassis »

Thanks mate! More simple than I thought.
User avatar
Tony Li
Posts: 21965
Joined: Thu Jul 18, 2013 1:27 pm

Re: How to utilize ChatMapperConverter class in my scripts?

Post by Tony Li »

Happy to help!
Post Reply