Modding Tutorials: Asset-Injection

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

Re: Modding Tutorials: Asset-Injection

Post by TheLacus »

MasonFace wrote: Mon Sep 02, 2019 3:03 pm Sorry to dig this back up, but I just had someone post on the Nexusmods page for PVE that the ghosts are showing full black instead of transparency like in this screenshot from before.

I have confirmed that it is working as expected in Unity, but it doesn't work correctly in DFU on my computer. I've double checked that I have a dummy material packaged in the DFMOD file with the standard shader and fade rendering mode. I named the material "Fade_Dummy".

Can you double check and see if the previous package that you got working in DFTFU also works in the final build on your machine?
No, it doesn't; i think the issue is that material is created at runtime and required standard shader variant is apparently not available if provided by an assetbundle. Sorry for giving a false hope. I'll need to include fade variant with core game, which is also a requirement to support loose files anyway.

User avatar
MasonFace
Posts: 543
Joined: Tue Nov 27, 2018 7:28 pm
Location: Tennessee, USA
Contact:

Re: Modding Tutorials: Asset-Injection

Post by MasonFace »

Sorry for giving a false hope.
Sorry I gave you false hope earlier when I thought it was working! lol

And that's okay, I know you'll get it working once you get it integrated into the core game.

You're still the man, TheLacus!

User avatar
TheLacus
Posts: 1305
Joined: Wed Sep 14, 2016 6:22 pm

Re: Modding Tutorials: Asset-Injection

Post by TheLacus »

Ok, Fade rendermode should now work for both mods and loose files. :)

User avatar
MasonFace
Posts: 543
Joined: Tue Nov 27, 2018 7:28 pm
Location: Tennessee, USA
Contact:

Re: Modding Tutorials: Asset-Injection

Post by MasonFace »

Awesome! Will this take effect with the next DFU release?

User avatar
TheLacus
Posts: 1305
Joined: Wed Sep 14, 2016 6:22 pm

Re: Modding Tutorials: Asset-Injection

Post by TheLacus »

MasonFace wrote: Tue Sep 10, 2019 3:32 pm Awesome! Will this take effect with the next DFU release?
Yes ;)
Thank you for reporting the issue, feedback from mod authors is very useful!

User avatar
MasonFace
Posts: 543
Joined: Tue Nov 27, 2018 7:28 pm
Location: Tennessee, USA
Contact:

Re: Modding Tutorials: Asset-Injection

Post by MasonFace »

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?

Thanks!

User avatar
TheLacus
Posts: 1305
Joined: Wed Sep 14, 2016 6:22 pm

Re: Modding Tutorials: Asset-Injection

Post by TheLacus »

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?

Thanks!
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.

Alth
Posts: 28
Joined: Wed Feb 20, 2019 9:59 pm
Location: New Zealand

Re: Modding Tutorials: Asset-Injection

Post by Alth »

I don't know what I'm doing wrong but I can't get models to replace the ones in the game. I followed all the tutorials and read all the posts people made.

When this tutorial says "unity will import it and create a folder called Materials, containing one .mat file for every material included in the fbx." There is no materials folder being created and even if I create one the model doesn't change in game.

I make the model into a prefab and add it to the modbuilder, build it and then put the dfmod in streamingassets/mods (doesn't work), I put it in streamingassets itself (nope), I try putting the prefab in to no avail. The startup sees the mod but nothing changes in the game. I have tried everything but none of it works.

I must be missing something fundamental to the process.

User avatar
TheLacus
Posts: 1305
Joined: Wed Sep 14, 2016 6:22 pm

Re: Textures

Post by TheLacus »

TheLacus wrote: Sat Feb 04, 2017 12:51 am Save Manager
It is possible to customize the window interface used to load saves, placing custom textures inside StreamingAssets\Textures.
This feature is now obsolete and will be eventually removed at some point. Hazelnut introduced support for full UI customization, which supersede this early support for one specific window. Mod authors interested in UI modding are invited to use the UIWindowFactory class to register modifications for window type UIWindowType.UnitySaveGame as a better replacement.

User avatar
TheLacus
Posts: 1305
Joined: Wed Sep 14, 2016 6:22 pm

Re: Modding Tutorials: Asset-Injection

Post by TheLacus »

Build 0.10.15 introduces support for injection of custom npcs graphics. It was already possible to replace interior npcs (which never move) with custom prefabs, but now is also possible to customize the wandering npcs found inside towns.

This is a bit more advanced than usual asset replacement due to the nature of npcs being entities that moves and interact with the player. Nevertheless, it's now possible to change the graphical part of the npc without breaking other functionalities like AI and Talk system.

The core of this feature is the abstract class MobilePersonAsset. A mod can inherit from it to create a custom component responsible for instantiating assets for different person types. This allows to inject 3d models but also other kinds of customization based on billboards.

If you are interested you can find more informations here.

Post Reply