File structure when locating textures in xml defs - does it matter?

Started by TrueDestroyer, October 04, 2016, 06:51:26 AM

Previous topic - Next topic

TrueDestroyer

tl; dr: Can texture location cause an error on load? Like when its not in  Things/Pawn/Humanlike/Apparel/ but elsewhere? (and adressed accordingly in xml?)


I had a mod that adds new items and it works just fine for me.
For convenience (just my convenience, not necessairly everyone else's conveneince) I'm putting all the textures for my mods in the textures folder directly, so in xml it is easier to access them
and I have just stuff like
<texPath>Exoskeleton</texPath>
instead of
<texPath>Things/Pawn/Humanlike/Apparel/Exoskeleton/Exoskeleton</texPath>
There is no difference from the game loading point is there?

One guy pointed out that he gets errors on loading saved game. He told me only about one he rembered from the wall of red text - "Not able to load Thing_Apparel_Industrial_LightExoskeleton, loading Apparel_Industrial_LightExoskeleton instead". This does not appear to be a critical error, also I could not reproduce this error, but it seems that it's connected to texture location. Or maybe its about the xml def location? I put the defs in vanilla like folder structures out of superstition though.

The only thing in my mods that differs from vanilla defs is this texture location, could it be a cause to critical error on load?

- my vanilla friendly balanced mods and game fixes.

Shinzy

Textures can be put anywheres within the textures folder
Usually when there's a texture error in the log it's just a side effect of something else not working (It doesn't load any textures that would be loaded after the error)

(atleast based on my own experience, I fully intend to blame Skullywag for everything if I'm wrong)

skullywag

Remember certain graphic_classes will want you to point to a folder not an actual file though.
Skullywag modded to death.
I'd never met an iterator I liked....until Zhentar saved me.
Why Unity5, WHY do you forsake me?

JadedApprentince

I'm having basically the same problem, the mod I made adds 7 new guns to the game, and they actually work I have been able to equip them, shoot them, spawn them, etc. Only the texture isn't being loaded, even if the actual path is there.
Here's the error I get:
"Could not load UnityEngine.Texture2D at Rimworld/Mods/EWE/Textures/(Texture) in any active mod or in base resources."
Mods I've made:
Combat Extended Artillery :  https://ludeon.com/forums/index.php?topic=33979.0

JadedApprentince

Quote from: skullywag on October 04, 2016, 07:10:52 AM
Remember certain graphic_classes will want you to point to a folder not an actual file though.
Even though I had done this, it will still give the error above, so I don't know if its an incompatibility error, an error in folder structure, or something else I completely missed.
Mods I've made:
Combat Extended Artillery :  https://ludeon.com/forums/index.php?topic=33979.0

Shinzy

Jaded! I believe you have too detailed file path
the startup point from where it begins the search for textures is the Textures folder
so if your guns are directly in the base of the 'Textures' the path should be just
<texPath>(texture)</texPath> instead of
<texPath>Rimworld/Mods/EWE/Textures/(Texture)</texPath>

And guns being graphic_single they do not need a separate folder either

JadedApprentince

#6
Thanks! This was the one problem pertaining to my mod EWE (Energy Weapons Expanded) and now that makes so much more sense!

EDIT : Welp, I did change all the textures like you said, but I still keep getting the same error. Maybe my process of making them is what might have made them "broken..."
Here's my process:
1.Take original texture from DL (I'll use the pistol for an example) and open it in Paint.
2.Recolor said weapon to match the style I wanted.
3.Save said texture as a PNG.
4.Use TEXTool>TEXCreator, which would then convert these PNG files into .tex files.
5.Insert said .tex files into EWE Textures Folder.

Maybe that's where I went wrong, if there's a better way then that would be helpful.
Mods I've made:
Combat Extended Artillery :  https://ludeon.com/forums/index.php?topic=33979.0

Dingo


JadedApprentince

#8
Quote from: Dingo on November 27, 2016, 10:06:22 PM
You don't need to make them tex files. Unity reads PNG.
Ok, I'll try that then (God this is so confusing and complicated now).

EDIT : I'm still getting the same loading error pointing to Unity2D...
At this point I don't know what's wrong, I can provide a copy of the mod if you want to look at it. :P
Mods I've made:
Combat Extended Artillery :  https://ludeon.com/forums/index.php?topic=33979.0

Shinzy

Quote from: JadedApprentince on November 27, 2016, 11:44:10 PM
Quote from: Dingo on November 27, 2016, 10:06:22 PM
You don't need to make them tex files. Unity reads PNG.
Ok, I'll try that then (God this is so confusing and complicated now).

EDIT : I'm still getting the same loading error pointing to Unity2D...
At this point I don't know what's wrong, I can provide a copy of the mod if you want to look at it. :P

Please do! ;D

JadedApprentince

Here's a copy of some of the mod data, it won't let me directly post the whole folder, but the XML code and a PNG is there to look at. If you need anything else let me know.

[attachment deleted by admin due to age]
Mods I've made:
Combat Extended Artillery :  https://ludeon.com/forums/index.php?topic=33979.0

Shinzy

Quote from: JadedApprentince on November 28, 2016, 06:22:20 PM
Here's a copy of some of the mod data, it won't let me directly post the whole folder, but the XML code and a PNG is there to look at. If you need anything else let me know.

Ah, I do think you'll have to either A) remove the ".tex" from the filename
or B) add it to the filepath <texPath>IonicPistol.tex</texPath>

you only need the .png there
Edit:(apololpollopologies for the late reply! I've been a bit busy)

JadedApprentince

Quote from: Shinzy on December 01, 2016, 06:10:47 PM
Quote from: JadedApprentince on November 28, 2016, 06:22:20 PM
Here's a copy of some of the mod data, it won't let me directly post the whole folder, but the XML code and a PNG is there to look at. If you need anything else let me know.
Ok Thanks

Ah, I do think you'll have to either A) remove the ".tex" from the filename
or B) add it to the filepath <texPath>IonicPistol.tex</texPath>

you only need the .png there
Edit:(apololpollopologies for the late reply! I've been a bit busy)
Mods I've made:
Combat Extended Artillery :  https://ludeon.com/forums/index.php?topic=33979.0