Custom Helm-Slot Item Not Showing On Paper-Doll

Discuss modding questions and implementation details.
Post Reply
User avatar
Magicono43
Posts: 1141
Joined: Tue Nov 06, 2018 7:06 am

Custom Helm-Slot Item Not Showing On Paper-Doll

Post by Magicono43 »

Trying to add some jewelry items in a mod, gotten to the tiara and crown items. While they are rendering and functioning fine just like all the other added items so far in the inventory and item-icons and such. With these Tiaras, I have their equip-slot set to the "Helm" slot. However, when I equip the item it is not showing up on the paper-doll at all it seems. Any idea why this might be?

I mostly copy and pasted my procedure from the "Roleplay Realism: Items" mod, so I have the XML files included with the texture file and such, I have the Unity meta data settings correct so there is no errors being thrown up in that regard. I thought for a moment it is was due to the body morphology stuff, but I tested with the first of the races for this being female argonian and it still was not showing up. I have the item template seemingly correct. So yeah, kind of at a loss of what to try next. I have gotten these items to work in a separate fork months back on another project, but never through the proper DFU modding system.

Here is the source for the mod, the Tiara item is index "4704":
DFU-Mod_Jewelry-Additions.rar
(128.54 KiB) Downloaded 60 times
Not sure what to try next honestly, so if I can't figure it out somewhat soon I'll probably just add the tiaras and crowns as some other equip slot accessory for now, and hopefully be able to figure it out another time to get them properly wearable on the paper-doll and such. But obviously would like to get this to work the first version and such, thanks for any help.

User avatar
BadLuckBurt
Posts: 948
Joined: Sun Nov 05, 2017 8:30 pm

Re: Custom Helm-Slot Item Not Showing On Paper-Doll

Post by BadLuckBurt »

On the technical side, everything seems to work. I've added some debugging in my local DFU and if I have two tiaras in my inventory, I can swap them out by equipping them and the one that gets unequipped shows up in the inventory again. The Head slot is also properly returned, the problem seems to lie in the paperdoll rendering itself which I'm not familiar with in the slightest.

But on the other hand, is it possible you are missing a mask texture? If you check here under Paperdoll: https://www.dfworkshop.net/projects/dag ... /textures/, this might be one of the cases where you need one.
DFU on UESP: https://en.uesp.net/w/index.php?title=T ... fall_Unity
DFU Nexus Mods: https://www.nexusmods.com/daggerfallunity
My github repositories with mostly DFU related stuff: https://github.com/BadLuckBurt

.

User avatar
Magicono43
Posts: 1141
Joined: Tue Nov 06, 2018 7:06 am

Re: Custom Helm-Slot Item Not Showing On Paper-Doll

Post by Magicono43 »

BadLuckBurt wrote: Tue Dec 28, 2021 4:29 pm On the technical side, everything seems to work. I've added some debugging in my local DFU and if I have two tiaras in my inventory, I can swap them out by equipping them and the one that gets unequipped shows up in the inventory again. The Head slot is also properly returned, the problem seems to lie in the paperdoll rendering itself which I'm not familiar with in the slightest.

But on the other hand, is it possible you are missing a mask texture? If you check here under Paperdoll: https://www.dfworkshop.net/projects/dag ... /textures/, this might be one of the cases where you need one.
Hey Burt, I was considering that as well, and you might be correct. I think Hazelnut for RPR:I gets away with not including a custom mask file by reusing one from the vanilla textures and doing some other magic later to make it still use their custom texture somehow. But I will try and include a mask file in my case and see if that might change anything. Thanks for taking the time to try and troubleshoot, I'll update if I get any result.

User avatar
BadLuckBurt
Posts: 948
Joined: Sun Nov 05, 2017 8:30 pm

Re: Custom Helm-Slot Item Not Showing On Paper-Doll

Post by BadLuckBurt »

Magicono43 wrote: Tue Dec 28, 2021 4:40 pm Hey Burt, I was considering that as well, and you might be correct. I think Hazelnut for RPR:I gets away with not including a custom mask file by reusing one from the vanilla textures and doing some other magic later to make it still use their custom texture somehow. But I will try and include a mask file in my case and see if that might change anything. Thanks for taking the time to try and troubleshoot, I'll update if I get any result.
I decided to dive in a little deeper and I've got it semi-working. The Head slot only equips Armor items by the looks of it and the position on the paperdoll was off but that should just be a matter of XML tweaking. I don't think you need a mask, it worked without one for me.

Code-wise I changed:

Code: Select all

public ItemTiara() : base(ItemGroups.Jewellery, templateIndex)
to

Code: Select all

public ItemTiara() : base(ItemGroups.Armor, templateIndex)
and I added this method to the class:

Code: Select all

        public override int GetMaterialArmorValue()
        {
            return 0;
        }
I also tried changing the equip slot to Amulet0 and that worked right away so with the changes above, you should see the tiara appear on the paperdoll.
DFU on UESP: https://en.uesp.net/w/index.php?title=T ... fall_Unity
DFU Nexus Mods: https://www.nexusmods.com/daggerfallunity
My github repositories with mostly DFU related stuff: https://github.com/BadLuckBurt

.

User avatar
Magicono43
Posts: 1141
Joined: Tue Nov 06, 2018 7:06 am

Re: Custom Helm-Slot Item Not Showing On Paper-Doll

Post by Magicono43 »

Alright awesome, thanks for the extra work there Burt, your method seems to work. Now I just have to see if I can somehow hack it some more to make it less weird if I'm going to be forced to have it classified as a piece of armor, but will have to see with some trial and error. At least now I can see the damn item on the paper-doll like I wanted, that's the more important aspect, lol.

User avatar
Magicono43
Posts: 1141
Joined: Tue Nov 06, 2018 7:06 am

Re: Custom Helm-Slot Item Not Showing On Paper-Doll

Post by Magicono43 »

So I might have found why certain items groups don't show on the paper-doll

From "PaperDollRenderer.cs":

Code: Select all

// Blit items
        void BlitItems(PlayerEntity entity)
        {
            // Create list of all equipped items
            List<DaggerfallUnityItem> equippedItems = new List<DaggerfallUnityItem>();

            // Find equipped slots, skip empty slots
            foreach (var item in entity.ItemEquipTable.EquipTable)
            {
                if (item != null)
                    equippedItems.Add(item);
            }

            // Sort equipped items by draw order
            List<DaggerfallUnityItem> orderedItems = equippedItems.OrderBy(o => o.drawOrder).ToList();

            // Blit item images
            foreach (var item in orderedItems)
            {
                if (item.ItemGroup == ItemGroups.MensClothing || item.ItemGroup == ItemGroups.WomensClothing ||
                    item.ItemGroup == ItemGroups.Armor || item.ItemGroup == ItemGroups.Weapons)
                {
                    BlitItem(item);
                }
            }
        }
Simply adding "ItemGroups.Jewelry" appears to have allowed the item to render proper on the paperdoll:

Code: Select all

// Blit item images
            foreach (var item in orderedItems)
            {
                if (item.ItemGroup == ItemGroups.MensClothing || item.ItemGroup == ItemGroups.WomensClothing ||
                    item.ItemGroup == ItemGroups.Armor || item.ItemGroup == ItemGroups.Weapons || item.ItemGroup == 				 
 		    ItemGroups.Jewellery)
                {
                    BlitItem(item);
                }
            }
So I will possibly make a PR at some point to try and work around this that would hopefully not cause any issues, or add a line somewhere that checks in some other way to render items that are not "normally" renderable in those body slots like jewelry or something. For now though I'll just have to have the items be considered armor for this purpose at least.

User avatar
BadLuckBurt
Posts: 948
Joined: Sun Nov 05, 2017 8:30 pm

Re: Custom Helm-Slot Item Not Showing On Paper-Doll

Post by BadLuckBurt »

Yes, it seems likely that was the culprit. Vanilla Daggerfall doesn't have any clothing items resembling jewelry so it makes sense.

I don't think this change would conflict with the vanilla data so if your PR gets accepted, it would open the door for wearable jewelry mods.
DFU on UESP: https://en.uesp.net/w/index.php?title=T ... fall_Unity
DFU Nexus Mods: https://www.nexusmods.com/daggerfallunity
My github repositories with mostly DFU related stuff: https://github.com/BadLuckBurt

.

User avatar
Magicono43
Posts: 1141
Joined: Tue Nov 06, 2018 7:06 am

Re: Custom Helm-Slot Item Not Showing On Paper-Doll

Post by Magicono43 »

BadLuckBurt wrote: Thu Dec 30, 2021 3:23 pm Yes, it seems likely that was the culprit. Vanilla Daggerfall doesn't have any clothing items resembling jewelry so it makes sense.

I don't think this change would conflict with the vanilla data so if your PR gets accepted, it would open the door for wearable jewelry mods.
Will just have to see if this would count as a "feature" in terms of the feature-locking thing, lol. I checked with the other jewelry pieces that go into the accessory slots, and there did not seem to be any case where the items were rendering on the paper-doll in anyway, except when you specify that the piece goes into a slot on the body. So hopefully should be no issues there.

Post Reply