0.10.4 MODDING: Paperdoll - cant unequip anything

Post here if you need help getting started with Daggerfall Unity or just want to clarify a potential bug. Questions about playing or modding classic Daggerfall should be posted to Community.
Post Reply
User avatar
King of Worms
Posts: 4753
Joined: Mon Oct 17, 2016 11:18 pm
Location: Scourg Barrow (CZ)
Contact:

0.10.4 MODDING: Paperdoll - cant unequip anything

Post by King of Worms »

When the paperdoll loose files are packed as DFMOD, you suddenly cant unequip anything from the paperdoll...
(I speak about weapons, armor, clothing)

U click on the paperdoll with equip/use command and nothing happens, no matter where u click...

I can equip things IN (like - clicking a dagger in the inventory and it will equip to paperdoll)
But I cant equip anything OUT (like clicking the dagger held in paperdoll hand to put it back in inventory)

This is DFMOD specific, it worked ok with a loose files

This is how I had things set up in inspector
insp.jpg
insp.jpg (148.98 KiB) Viewed 1714 times

User avatar
Interkarma
Posts: 7247
Joined: Sun Mar 22, 2015 1:51 am

Re: 0.10.4 MODDING: Paperdoll - cant unequip anything

Post by Interkarma »

Interesting! I'll try to theorycraft what the problem might be and maybe TheLacus can suggest something to help also.

To unequip from the paper doll first uses a rectangle check to find the correct texture based on placement, then it reads from the texture itself to find which specific texture the player clicked on. For example, it's possible to click on a shirt through chainmail.

If the texture once packed into a .dfmod is no longer readable, then it would prevent this mechanism from working correctly. It will be necessary that all paper doll textures remain readable when importing from loose or .dfmod.

If you tick the read/write enabled checkbox in import settings, I'm hoping this will help. Let me know how you go!

User avatar
King of Worms
Posts: 4753
Joined: Mon Oct 17, 2016 11:18 pm
Location: Scourg Barrow (CZ)
Contact:

Re: 0.10.4 MODDING: Paperdoll - cant unequip anything

Post by King of Worms »

Hi, I repacked the DFMOD with Read write enabled settings and now it works.
Is this how it should be? I mean, its 12k+ files with this flag enabled, and from what I know, this consumes more memory...
Just want to be sure.

User avatar
Interkarma
Posts: 7247
Joined: Sun Mar 22, 2015 1:51 am

Re: 0.10.4 MODDING: Paperdoll - cant unequip anything

Post by Interkarma »

As the Daggerfall paper doll uses image output to click on items to unequip, there must be a way to sample which pixels the player is actually clicking on. It's possible to click on items through other items (e.g. click on pants or shirt though gaps in armor) so broad-phase rect and layer order alone isn't adequate. The final test needs to be done on a per-pixel basis to remain accurate to the Daggerfall way of doing things.

It would be possible to use the classic 8-bit image for pixel tests, provided the replacement item is only slightly different in shape. But it would no longer be pixel perfect due to resolution differences, and modded items might have a different topology to classic items. So a simple pixel test is the best method to preserve Daggerfall's way of doing things.

I agree with what you're saying though. I might be able to refine shader to output mask information to a second RenderTexture, which can then be sampled for hit tests under the mouse without requiring modded texture to be readable. I've added a note to my internal tracking and will look at this when I can.

This whole setup would be a lot easier if Daggerfall used equipment slots everywhere like it does for jewellery, etc. Then it's just a simple rect check on the slot. Alas, this game loves to challenge me. :)

User avatar
King of Worms
Posts: 4753
Joined: Mon Oct 17, 2016 11:18 pm
Location: Scourg Barrow (CZ)
Contact:

Re: 0.10.4 MODDING: Paperdoll - cant unequip anything

Post by King of Worms »

Thanks for a detailed reply mate. Yes sometimes the process can get quite chalenging indeed :lol:
No worries, it will turn out proper one day.

I try to make this paperdoll replacement work, its really tough, esp the testing part. I find bugs ocassionally with items not being replaced with the high res art and staying the vanilla.

And the testing is almost impossible, because there are too many items.

Would it be possible to add a console command "Add all"

That would help, so I can test everything, without looking for these items in the world..

Thank you ;)

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

Re: 0.10.4 MODDING: Paperdoll - cant unequip anything

Post by TheLacus »

King of Worms wrote: Mon Aug 19, 2019 12:08 pm That would help, so I can test everything, without looking for these items in the world..
I don't know if you noticed but i added console commands to add specific items, no need to find them in game ;)

User avatar
King of Worms
Posts: 4753
Joined: Mon Oct 17, 2016 11:18 pm
Location: Scourg Barrow (CZ)
Contact:

Re: 0.10.4 MODDING: Paperdoll - cant unequip anything

Post by King of Worms »

TheLacus wrote: Mon Aug 19, 2019 1:32 pm
King of Worms wrote: Mon Aug 19, 2019 12:08 pm That would help, so I can test everything, without looking for these items in the world..
I don't know if you noticed but i added console commands to add specific items, no need to find them in game ;)
Thats nice - thank you - but still basically impossible to use to test everything this way :X

Maybe like this:

Add_weapon male
Add_weapon female

so this command adds all weapons of male/female (if the gender needs to be specified)

Add_armor = add all armors

Add_clothing = add all clothing

etc

Otherwise, just the amount of commands needed to test everything goes to unrealistic amounts, many 1000s Im affraid (my paperdoll folder has almost 13k files btw)

Also, Ive updated this bug report about things not being replaced on paperdoll
viewtopic.php?f=5&t=2550

Thanks for looking at this Lacus!

Post Reply