[0.10.21] XML files are incorrectly retrieved as Texture2D when provided alone

Curated user bug reports with enough information to reproduce issue. Moderators will move topics here from Help & Support once a bug is confirmed and enough information has been provided.
Post Reply
User avatar
Ralzar
Posts: 969
Joined: Mon Oct 07, 2019 4:11 pm
Location: Norway

[0.10.21] XML files are incorrectly retrieved as Texture2D when provided alone

Post by Ralzar » Wed Mar 11, 2020 4:45 pm

So I tried to figure out the code for mod dependencies, but unless I am missing something it seem to only be able to do the opposite of what I need.

I need my mod Meaner Monster, to specify that if present, DREAM has to be listed BELOW my mod.

From what I've found of options, I am only able to specify that DREAM should be listed above. Which is the opposite of what I want.

Meaner monsters changes sprite sizes. If it DREAM loads first, it also reverts those sprites to vanilla sprites.


I believe Villager Immersion Overhaul has the same problem. It needs to be listed above DREAM in the mod list. But it seems only DREAM can specify this. Maybe to avoid conflicts if both mods specify the opposite load order?
My released mods

"I feel like Ralzar specifically wrote those mods for me and then said "Use them". Just so he could watch me die more."
-FuzzyBeanPlays

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

Re: Mod Dependencies options

Post by TheLacus » Wed Mar 11, 2020 5:44 pm

Load order is the same as in Skyrim and other Bethesda games, so you want to run your mod after DREAM to override its xml files (if any). In other words, if B depends on A then you need to "install" A before you "install" B. This is why i used the word dependency.
Ralzar wrote:
Wed Mar 11, 2020 4:45 pm
So I tried to figure out the code for mod dependencies
Maybe you know this already, but the documentation can be found here.
Mod System documentation - Learn how to create mods for Daggerfall Unity.
Modder Discussion - General help and discussion for the mod system.
Github Issues - Submit a bug report for the game, including the mod system.

User avatar
Ralzar
Posts: 969
Joined: Mon Oct 07, 2019 4:11 pm
Location: Norway

Re: Mod Dependencies options

Post by Ralzar » Wed Mar 11, 2020 6:11 pm

Unless I am misunderstanding: "Above" means above it in the list. Not above it in load order?

The goal here is for the DREAM sprite to be used. With the two load orders, this is the results:

Meaner Monsters BELOW:
cWolf.png
cWolf.png (472.46 KiB) Viewed 115 times

Meaner Monsters ABOVE:
dWolf.png
dWolf.png (509.53 KiB) Viewed 115 times

Maybe the real problem here is how xml files are loaded?
Last edited by Ralzar on Wed Mar 11, 2020 6:22 pm, edited 1 time in total.
My released mods

"I feel like Ralzar specifically wrote those mods for me and then said "Use them". Just so he could watch me die more."
-FuzzyBeanPlays

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

Re: Mod Dependencies options

Post by TheLacus » Wed Mar 11, 2020 6:22 pm

If you place Meaner Monsters after DREAM, Meaner Mosters overrides DREAM. If DREAM only contains textures and Meaner Monsters only contains xml files, everything works together no matter the load order. If both contain the same asset, the last mod in the load order overrides everything before it.

If your mod is shipping vanilla textures you simply need to stop doing it and only provide xml files. If this is causing issues i'm happy to give a look as i said in another topic. ;)
Mod System documentation - Learn how to create mods for Daggerfall Unity.
Modder Discussion - General help and discussion for the mod system.
Github Issues - Submit a bug report for the game, including the mod system.

User avatar
Ralzar
Posts: 969
Joined: Mon Oct 07, 2019 4:11 pm
Location: Norway

Re: Mod Dependencies options

Post by Ralzar » Wed Mar 11, 2020 8:59 pm

TheLacus wrote:
Wed Mar 11, 2020 6:22 pm
If you place Meaner Monsters after DREAM, Meaner Mosters overrides DREAM. If DREAM only contains textures and Meaner Monsters only contains xml files, everything works together no matter the load order. If both contain the same asset, the last mod in the load order overrides everything before it.

If your mod is shipping vanilla textures you simply need to stop doing it and only provide xml files. If this is causing issues i'm happy to give a look as i said in another topic. ;)
Now you made me doubt myself :D

So, I extracted the files from the exact modfile I was using in the pictures above. I am not supplying any sprites in my mod. There is just one .cs file and a bunch of .xml files to change the sprite scale. Attached extracted dfmod file below.

Edit: and yes, this is the old version where I have an xml frame for every single frame. I have a newer version with only the needed xml files. I just built a mod of that and recreated the same behaviour.
Attachments
MeanerMonsters.dfmod.zip
(901 Bytes) Downloaded 3 times
My released mods

"I feel like Ralzar specifically wrote those mods for me and then said "Use them". Just so he could watch me die more."
-FuzzyBeanPlays

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

Re: Mod Dependencies options

Post by Hazelnut » Wed Mar 11, 2020 9:19 pm

Is it not that the xml files are in both mods? Dunno maybe I am not following here.
See my mod code for examples of how to change various aspects of DFU: https://github.com/ajrb/dfunity-mods

User avatar
Ralzar
Posts: 969
Joined: Mon Oct 07, 2019 4:11 pm
Location: Norway

Re: Mod Dependencies options

Post by Ralzar » Wed Mar 11, 2020 9:22 pm

Hazelnut wrote:
Wed Mar 11, 2020 9:19 pm
Is it not that the xml files are in both mods? Dunno maybe I am not following here.
Yes, but XML files only change the size, so should, at worst, make the dream sprites deformed. Instead they make them revert to classic when the mods are loaded in the order that should lead to dream loading over my xml files.
It only works correctly when they're loaded the opposite way of what is expected, which is why I was wondering if I was misunderstanding the load order.

Maybe what is happening is that my mod defines the xmls and then the dream sprites do not get loaded because there's a limit to how many times you can load the same xml? And then the corresponding sprite isn't loaded either?
Edit: no wait, that's not right since it works when my xml files get loaded last. Loading over the dream xml files. (If dream has xml files)?
Edit2: DREAM-SPRITES only loads sprites. Not xml files.
My released mods

"I feel like Ralzar specifically wrote those mods for me and then said "Use them". Just so he could watch me die more."
-FuzzyBeanPlays

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

Re: Mod Dependencies options

Post by TheLacus » Wed Mar 11, 2020 10:32 pm

Might be a cast issue because textures and xml files shares the same name. Unity API allows to seek for a specific name and type combination, but our internal code may not be as robust and try to use whatever asset is found first as a texture. I'll see what i can do to avoid this situation.

EDIT: Fixed with #1752.
Mod System documentation - Learn how to create mods for Daggerfall Unity.
Modder Discussion - General help and discussion for the mod system.
Github Issues - Submit a bug report for the game, including the mod system.

Post Reply