%ModDir% for modded creature textures doesn't always implicitly point to one's own mod's filepath
Disclaimers
- [X] I have searched the issue tracker to check if the issue has already been reported.
- [X] My issue happened while using mods.
What happened?
This issue is pretty hard to describe as it has occurred in other instances other than the one described in this post. I'm fairly certain that it only happens for creature textures and nothing else.
When you create a new character and define its textures within its ragdoll, you usually type your filepaths like this:
%ModDir%/Characters/Crawler/crawler.png
This means that the game has to look inside "ModDir" to then find the "crawler.png" file inside two other folders.
For pretty much everything else in the game, such as sounds or textures for items, %ModDir% on its own implicitly means LocalMods/YourMod, where YourMod is the name of your mod.
However for creature textures, it is often required to specify the name of your mod within %ModDir%, so that the filepath becomes like this:
%ModDir:YourMod%/Characters/Crawler/crawler.png
This would normally be necessary to reference files from other mods, but here it seems that it is necessary to specify the name of your own mod in order for certain things not to break. The things that can break vary a lot, but I managed to find a way to easily verify one problem in particular: Testcrawl.zip
This mod overrides the crawler character and changes its texture to something else, and its filepath looks like the one I put at the beginning of this post. If you were to then check out the "crawler_large" character in the character editor, you'd see that it's invisible, while you'd expect that it would just use the same texture as your overridden crawler, as it doesn't have a custom texture of its own like the "crawler_hatchling" character, which works properly.
To fix this, you need to include the name of your mod after ModDir where the overridden crawler's texture is defined:
%ModDir:Testcrawl%/Characters/Crawler/crawler.png
The problem here is that you simply shouldn't have to type the name of your own mod for things to work properly, as %ModDir% on its own should mean that we're talking about your own mod already. At the very least, the practice of putting your mod's name after ModDir should be included in the official character modding guide, to reduce the amount of people running into problems because they didn't do so.
Bug prevalence
Happens every time I play
Version
0.18.15.0
Which operating system did you encounter this bug on?
Windows