Page 1 of 1

How to utilize ChatMapperConverter class in my scripts?

Posted: Wed Oct 05, 2022 6:29 pm
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# :).

Re: How to utilize ChatMapperConverter class in my scripts?

Posted: Wed Oct 05, 2022 9:45 pm
by Tony Li
Hi,

You can use these instructions to import Chat Mapper XML at runtime.

Re: How to utilize ChatMapperConverter class in my scripts?

Posted: Thu Oct 06, 2022 5:16 pm
by edassis
Thanks mate! More simple than I thought.

Re: How to utilize ChatMapperConverter class in my scripts?

Posted: Thu Oct 06, 2022 7:40 pm
by Tony Li
Happy to help!