(Bug Fix) Can someone take a look at this script made by JoshCamas please

Discuss Daggerfall Unity and Daggerfall Tools for Unity.
Post Reply
User avatar
King of Worms
Posts: 3824
Joined: Mon Oct 17, 2016 11:18 pm
Location: Scourg Barrow (CZ)
Contact:

(Bug Fix) Can someone take a look at this script made by JoshCamas please

Post by King of Worms »

Guys, I was given this script created by Josh Camas.
Its supposed to change the paperdoll background according to day/night and weather + dungeon location etc,
Its all described in the readme there.

Issue is:
when we started and it had only day/night variant, it worked. When it was extended with weather, it just stopped doing anything and since than we did not move anywhere (we bug fixed some issues on my side but it did not solve the issue)

So if any coder can take a look, and maybe see whats wrong there, I would be really happy.

I write it here because I want to release DREAM this year, and time is running up, and Josh does not have as much time as before. I hope it all right with him, I know its his script, but bugfixing it is always good for everyone. Plus its public on Git.

Thanks a lot

Link to script

https://github.com/joshcamas/dfu-charac ... nd-swapper

User avatar
pango
Posts: 2833
Joined: Wed Jul 18, 2018 6:14 pm
Location: France
Contact:

Re: (Bug Fix) Can someone take a look at this script made by JoshCamas please

Post by pango »

From a quick read, there's a few intriguing stuff, but something that's very certainly a bug is texture being assigned in loops l. 120, without a check whether it got assigned null or something else; So the value of texture after the loops will just be the last assigned value, no matter if that was the "successful" assignment of not (I'm not sure I'm very clear, I hope it makes sense).
By the way, fixing this will require to make sure it's the most "specific" texture that's picked by those loops, in case they're several candidate textures...
I think it would help to require tags to be in a specific order, say weather then day/night, to lower the number of filename checks. That should also simplify the logic.
If you have trouble getting it right, add unit tests.
When a measure becomes a target, it ceases to be a good measure.
-- Charles Goodhart

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

Re: (Bug Fix) Can someone take a look at this script made by JoshCamas please

Post by King of Worms »

Thanks a lot 😊 I have no idea how hard that would be to do. Also Im reluctant because the script is not mine.

Either way I apreciate you pointing us to the direction of possible issue. I hope Josh will come back. And also implement the last part he said he can do - dungeon background switch.

User avatar
Hazelnut
Posts: 2664
Joined: Sat Aug 26, 2017 2:46 pm
Contact:

Re: (Bug Fix) Can someone take a look at this script made by JoshCamas please

Post by Hazelnut »

Do you use this in Dream KoW? And did you get it fixed yet?
See my mod code for examples of how to change various aspects of DFU: https://github.com/ajrb/dfunity-mods

Post Reply