[Solved] Can't get Runtime Materials or Action Object working on replacement model

Discuss modding questions and implementation details.
Post Reply
User avatar
XJDHDR
Posts: 59
Joined: Thu Jan 10, 2019 5:15 pm
Location: New Zealand

[Solved] Can't get Runtime Materials or Action Object working on replacement model

Post by XJDHDR » Thu May 14, 2020 11:04 pm

I am trying to replace a portcullis model in the game but I can't get it to work properly with the Runtime Materials script or Action Object component. I have attached the model and prefab I've created as well as a save game you can use to test this:
Portcullis model files.zip
Model, prefab and save.
(791.01 KiB) Downloaded 48 times
The first problem is Runtime Materials. I attached the Runtime Materials script to my prefab and filled in the textboxes with the required numbers. I have also not assigned any materials through the inspector. However, the models ingame are still using the original game's textures. Looking at the images TheLacus added, it looks like he also did something to remove the material from the model (making it turn purple) but at the same time, I see that the material is still attached. I haven't been able to replicate this.

The second problem is that this model is supposed to rise when a nearby switch is activated (in this case, the wheel attached to the wall. The original model does so but my replacement model does not. First, I tried just creating a prefab without attaching any other components to it, since this worked when I replaced a trapdoor in a different area (and I'm under the impression that the engine automatically assigns these things). Next, I tried attaching the Daggerfall Action script. After that, I tried looking at the original model in the inspector, listed all of the components attached to that model and their settings and then configured my new model's prefab in exactly the same way. In all three cases, there was no change. The new model does not move when activated by the wheel.

Please can someone help me figure out what I've done wrong? Thanks.
Last edited by XJDHDR on Sun May 17, 2020 7:41 am, edited 1 time in total.
My mods (mainly for Oblivion but also a few for other games):
https://www.nexusmods.com/users/625820?tab=user+files

BadLuckBurt
Posts: 533
Joined: Sun Nov 05, 2017 8:30 pm

Re: Can't get Runtime Materials or Action Object working on replacement model

Post by BadLuckBurt » Fri May 15, 2020 5:34 pm

The issue is two-fold:

1. You have textures assigned to the prefab, empty those slots.
2. You have mixed up the values for the Runtime Materials component.

Index refers to the material slot on the model and you put the archive ID there, I've added a screenshot below of the correct setup and proof of it working in DFU.

Image

Image

@TheLacus, thanks again for this feature. It's awesome!
Daggerfall Unity on UESP: https://en.uesp.net/w/index.php?title=T ... fall_Unity
Daggerfall Unity on Nexus Mods: https://www.nexusmods.com/daggerfallunity
My github repositories with mostly DFU related stuff: https://github.com/BadLuckBurt

User avatar
XJDHDR
Posts: 59
Joined: Thu Jan 10, 2019 5:15 pm
Location: New Zealand

Re: Can't get Runtime Materials or Action Object working on replacement model

Post by XJDHDR » Sun May 17, 2020 7:41 am

Thank you for helping once again, BadLuckBurt.

You were right about my mistake. It was indeed a fail on my part. I assumed that the regular naming convention applied instead of properly reading. Runtime Materials is working now that I've corrected it. As for emptying the material slots, you don't need to do this per se. It just makes your mod bigger than it needs to be.

As for my second problem, I found that there was nothing wrong with my model. This problem was an unrelated bug in DFU that I've just reported.
My mods (mainly for Oblivion but also a few for other games):
https://www.nexusmods.com/users/625820?tab=user+files

Post Reply