Pls help me debug this script for Dynamic Paperdoll Backgrounds

Discuss modding questions and implementation details.
User avatar
King of Worms
Posts: 4752
Joined: Mon Oct 17, 2016 11:18 pm
Location: Scourg Barrow (CZ)
Contact:

Pls help me debug this script for Dynamic Paperdoll Backgrounds

Post by King of Worms »

Hi, this is a script Josh Camas wrote for me to enable the dynamic changes of paperdoll backgrounds (day, night, weather...)

https://github.com/joshcamas/dfu-charac ... grounds.cs

There is one bug tho.

When a player changes to werewolf/boar (which has its own static paperdoll image called BOAR00I0.IMG & WOLF00I0.IMG) and than goes into the dungeon, the result is that the dynamic background overwrites the BOAR/WOLF image and it looks like this:
gwkYyHK.jpg
gwkYyHK.jpg (409.28 KiB) Viewed 2116 times
When you are outside, it does not happen according to the reports I received.

Here is a save file, where the player is in the beast form and cant be seen because that image is overwritten by dungeon background.
bugged werewolf INV save.zip
(441.73 KiB) Downloaded 92 times

Expected behavior is, that if the player changes to beast form, no dynamic background will ever overwrite it. No matter if the player is inside, outside or what weather is currently going on.

I cant write scripts and Josh was not around for quite some time. I tried to contact him here at forums and on twitter, but Im not sure if it will be successful. So I ask for your help :geek:

Thank you!

l3lessed
Posts: 1400
Joined: Mon Aug 12, 2019 4:32 pm
Contact:

Re: Pls help me debug this script for Dynamic Paperdoll Backgrounds

Post by l3lessed »

Your issue is with public void UpdateCurrentTexture() routine. When he set this up, he has it automatically check if they are inside and then override all previous update texture names pulled. As a result, the transformation texture is automatically replaced by the interior texture.

It's this specific line of code.

Code: Select all

                if (GameManager.Instance.PlayerEnterEonxit.IsPlayerInside)
                    modVanillaName = "interior.IMG";
Just put in a quick check to see if the player has the effect, and only run the update if they are inside and are not in transformed racial form.

Code: Select all

                if (GameManager.Instance.PlayerEnterEonxit.IsPlayerInside && GameManager.Instance.PlayerEffectManager.GetRacialOverrideEffect() == null)
                    modVanillaName = "interior.IMG";
This should only update to interior when they do not transform into there form.
My Daggerfall Mod Github: l3lessed DFU Mod Github

My Beth Mods: l3lessed Nexus Page

Daggerfall Unity mods: Combat Overhaul Mod

Enjoy the free work I'm doing? Consider lending your support.

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

Re: Pls help me debug this script for Dynamic Paperdoll Backgrounds

Post by King of Worms »

Hi mate, thanks a lot! So I basically overwrite the top part with the bottom part in the script?

Just to be sure, there are many interior options in this script:
castle
dungeon
openshop
building

So I guess the line you mentioned with "interior.IMG" governs all these instances?

Thanks for your time!!

EDIT:
just made a quick test and it seems the issue was corrected ;)

can you please see in the script, if it has the day/night/weather variants when player is in beast mode? like it is when you are not changed? Id like to have at least day/night variant for it.

l3lessed
Posts: 1400
Joined: Mon Aug 12, 2019 4:32 pm
Contact:

Re: Pls help me debug this script for Dynamic Paperdoll Backgrounds

Post by l3lessed »

Upon openning daggerfall imagging tool and checking the lycronthropy paperdoll .img textures, they do not have an alpha layer for their background. So, all you need to do is export the current default wearboar and wearwolf paperdoll image, clip out the background, turn it black/alpha compatible, and reimport the new one.

This can be seen under the img files and the file titled "BOAR0010.img". The background is set already as the night time one instead of a black alpha layer as seen with the normal character paperdolls.

Upon loading the new one, you should get the werebeast paperdoll with the continually updating background instead of the permanent night one built into the paperdoll.
My Daggerfall Mod Github: l3lessed DFU Mod Github

My Beth Mods: l3lessed Nexus Page

Daggerfall Unity mods: Combat Overhaul Mod

Enjoy the free work I'm doing? Consider lending your support.

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

Re: Pls help me debug this script for Dynamic Paperdoll Backgrounds

Post by King of Worms »

Oh that would be genial! I will try it, thank you!

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

Re: Pls help me debug this script for Dynamic Paperdoll Backgrounds

Post by King of Worms »

I think I understood you wrong. What I thought was, that if I remove the beast form background, I will see the dynamic background instead. That would be really good and save a lot of work. Can the script be made this way?

As it is now, I can see this (img below - just a test) and that is the hard baked background in the inventory screen. So I know the dynamic backgound is not being rendered behind the beast form now.

If it was working this way, it would be a ultimate solution Id say...
Untitled-1.jpg
Untitled-1.jpg (886.63 KiB) Viewed 1967 times

l3lessed
Posts: 1400
Joined: Mon Aug 12, 2019 4:32 pm
Contact:

Re: Pls help me debug this script for Dynamic Paperdoll Backgrounds

Post by l3lessed »

no, the script cannot remove the werebeast background and turn it to classic alpha layer. This has to be done via photos hop editing the image.

I would still do this and try it before you do anything else. What you're seeing is still a conflict of the baked in werebeast background conflicting with the dynamic background.

In the image below, is the baked in werebeast background been removed? If not, try manually changing the paper doll in a program to remove the background and get it imported back in so it matches the normal paper dolls. Aka, black alpha layer background.
My Daggerfall Mod Github: l3lessed DFU Mod Github

My Beth Mods: l3lessed Nexus Page

Daggerfall Unity mods: Combat Overhaul Mod

Enjoy the free work I'm doing? Consider lending your support.

l3lessed
Posts: 1400
Joined: Mon Aug 12, 2019 4:32 pm
Contact:

Re: Pls help me debug this script for Dynamic Paperdoll Backgrounds

Post by l3lessed »

So scanning the script again, I was misunderstanding how it is working.

You're right, it grabs custom backgrounds for each transformation form. Do you want these used at all. If not try removing these two lines, like so.

Code: Select all

//Apply builtin racial effect names
                //vanillaName = TryGetVampirismTextureName();
                //vanillaName = TryGetLycanthropyTextureName();
This should remove the custom transformation backgrounds. Now, I think you'll still get the default built in background in the paperdoll.
My Daggerfall Mod Github: l3lessed DFU Mod Github

My Beth Mods: l3lessed Nexus Page

Daggerfall Unity mods: Combat Overhaul Mod

Enjoy the free work I'm doing? Consider lending your support.

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

Re: Pls help me debug this script for Dynamic Paperdoll Backgrounds

Post by King of Worms »

Thank you,

in case I did not explain properly:

I manually roughly deleted the baked-in werebeast background in that image I posted above, just as a proof of concept. And what you can see when I erase that background was that image I posted. You can see green trees as a background, in places where I deleted the were beast background.

But that green background is NOT the dynamic background, instead it is this:

This is directly from the HUD png files - not ingame - the green background you can see is baked in that image. Its NOT the new dynamic background I use in my paperdoll project.
INFO00I0.IMG.jpg
INFO00I0.IMG.jpg (744.64 KiB) Viewed 1926 times

So its like this:
When I delete the beast-form background, I start to see this inventory background above.

If the script placed the dynamic background there INSTEAD, it would be genial. It would work like standard paperdoll. SO the background would switch according to where you are, time of a day, weather. And the cut out beast-form would be placed on top of that.

What I want is this:

1) I will cut out the beast-form from its background
2) the standard dynamic background will be rendered behind it
3) done

Is it possible? I know it is :)

I just want this beast-form (when I cut the background out) to work like a normal paperdoll, with the dynamic backgrounds. I was not aware that its possible, until you mentioned. Than I realized this is a way to go.

PS: for better understanding, this is the ROUGH cutout I used as a proof of concept in the post above. I hope it makes sense, I tried :)
WOLF00I0.IMG.png
WOLF00I0.IMG.png (423.78 KiB) Viewed 1910 times

l3lessed
Posts: 1400
Joined: Mon Aug 12, 2019 4:32 pm
Contact:

Re: Pls help me debug this script for Dynamic Paperdoll Backgrounds

Post by l3lessed »

Think I found the issue.

The original code was setup to manually override the background image with the transformation background since it is all backed into one (the paperdoll and background). So, we need to tell it now to actually still pull the dynamic background along with the transformed paperdoll you have cropped how you want.

Code: Select all

                //Apply builtin racial effect names
                vanillaName = TryGetVampirismTextureName();
                vanillaName = TryGetLycanthropyTextureName();

                //Get vanilla image string
                if(vanillaName == null)
                    vanillaName = (string)RunMethod("GetPaperDollBackground", paperDoll, GameManager.Instance.PlayerEntity);
try this with your new transformation paperdoll textures you created with the alpha layer added.

Code: Select all

                //Apply builtin racial effect names
                //vanillaName = TryGetVampirismTextureName();
               //vanillaName = TryGetLycanthropyTextureName();

                //Get vanilla image string
               //if(vanillaName == null)
               
               vanillaName = (string)RunMethod("GetPaperDollBackground", paperDoll, GameManager.Instance.PlayerEntity);
If I think this is working how it is, it will now get the dynamic background and update the paperdoll. Now, I'm not 100% sure how the background and paperdoll updates are playing together, so try it out and let me know if it works as I think.
My Daggerfall Mod Github: l3lessed DFU Mod Github

My Beth Mods: l3lessed Nexus Page

Daggerfall Unity mods: Combat Overhaul Mod

Enjoy the free work I'm doing? Consider lending your support.

Post Reply