I'm attempting to create a mod that will use the UMA framework to dynamically generate humanoid characters in DFU. I intend to create a pool of UMA dynamic character avatars that are configured as needed to replace appropriate characters, starting with townsfolk using the Mobile Person Asset class.
I've cloned the latest version of DFTFU and have imported UMA into the project. I've created a mod with all the UMA prefabs and scripts needed to create a dynamic avatar. I created a script to initialize the mod, then load and instantiate the necessary singleton prefabs, then instantiated a dynamic avatar (what UMA calls the dynamically generated character mesh). Finally, I packaged the .dfmod and move it to Streaming Assets/Mods folder and... it works! I haven't used it to replace Mobile Person Assets yet; I've only just instantiated an avatar with its transform.position in the Privateer's Hold entrance cave area for testing purposes.
The problem is that it only works when playing inside Unity. This leads me to believe that this is a compiler issue with MCS.
Here's the problem: while UMA is open source and can be modified, there are 15 main scripts and the few that I've looked at are fairly complex. If I understand correctly, MCS has issues with the following:
- Generic Methods and Classes
- Struct Initializers
Is there a way to debug the MCS compiler to narrow down precisely where it's running into trouble, or am I better off looking for these issues (enums, generics, etc.) line-by-line in each script?
Looking ahead, if the UMA framework turns out to be too complex, or is too reliant on enums and/or generic methods to be considered reasonable to rewrite, is there a way to compile certain scripts ahead of time without having to integrate them directly into DFU core?
Thanks for your time!