Modding Tutorials: Asset-Injection

Discuss modding questions and implementation details.
Post Reply
User avatar
Posts: 1159
Joined: Wed Sep 14, 2016 6:22 pm

Re: Modding Tutorials: Asset-Injection

Post by TheLacus » Wed Mar 11, 2020 9:39 pm

TheLacus wrote:
Sat Sep 28, 2019 12:51 pm
MasonFace wrote:
Sun Sep 22, 2019 12:24 am
Hey TheLacus!

I was wanting to take a crack at making a mod that extends the behaviors of doors, but first I need a little help understanding how DFU handles placing particular doors in interiors and how a modder would inject a new prefab for specific doors.

I've had some success with replacing static props with a new prefab. I made a new fireplace with a slightly higher polycount mesh, a light source, PBR material, and a particle system. I just named the prefab "41116", included it in my dfmod and it worked! But now I'm getting confused on how to do the same with doors...

It looks like all the doors inherit from the base mesh 55000. From there, I'm guessing it relies on the tag system to assign it a specific material based on Climate and Season, but I'm having difficulty understanding how DFU maps "55000" to material 374_0-0, for instance in Privateer's hold. I'm guessing it's done with DaggerfallMesh.cs, but I'm not seeing how it all works together.

Anyhow, long story short, I've tried overriding the base 55000 mesh with a custom mesh expecting that all interior doors would fallback to this new mesh since I didn't include any climate or season tags, but I'm not seeing any results or errors in console.

How should I proceed with trying to create unique door prefabs that get injected properly?

If you look inside Assets/Prefabs/Scene you can find prefabs for interior doors. When they are loaded a DaggerfallMesh component is added directly and climate is set without seeking injected models, so unfortunately it's not possible to replace them right now. I opened an issue on Github.
This is now supported (not yet in builds). Quoting my commit:
Added support for injection of custom models of action doors used inside buildings and dungeons. The entire action door prefab is replaced, so mod authors need to ensure that DaggerfallActionDoor, DaggerfallAudioSource and other required components (or compatible replacements) are present.
I suggest playing the game inside the Unity Editor to retrieve ids for all doors (i.e. 9000 for buildings).
Mod System documentation - Learn how to create mods for Daggerfall Unity.
Modder Discussion - General help and discussion for the mod system.
Github Issues - Submit a bug report for the game, including the mod system.

Post Reply