{Solved} Texture errors?

Started by Azoth, October 22, 2016, 03:07:03 PM

Previous topic - Next topic

Azoth

I'm trying to get some custom textures to work, but my problem is I keep getting two errors;

cannot load  UnityEngine.Texture2D at Things/Weapons/Gun_Railgun in any active mod or in base resources
And
MatFrom with null sourceTex

I've checked a bunch of posts and tutorials, but they all pretty much say that it is because the path is wrong, but the texture is located in my mod folder like this: Textures/Things/Weapons/Gun_Railgun
The texture is saved as Gun_Railgun.tex and it is in PNG format.
I've tried various other folder setups, but I think I'm missing something simple and I've been trying to do this for hours now and I'm still stumped.

kaptain_kavern

Which  <graphicClass> did you use with this path ?
Also I'm not sure about the .tex    I may be wrong but it should be an old method because I've always used .png without problems.

If <graphicClass> is set to single, your <texPath> should point to the file (without writing the extension) so "Things/Weapons/Gun_Railgun/Gun_Railgun" if I got your particular case right.

It's only with <graphicClass> set to "multi" or "random" that <texPath> should point to a folder.


I'm not considering myself as an expert, I could be wrong. The only to be sure of it would be to try  :P

Keep us updated please  ;)

sulusdacor

#2
usally get this myself if i missspell my texture names or rename them in the process and forget something^^. your game (xml files) looks for the texture named:
Gun_Railgun.png

if you named it .tex and it would be in the png format, the file would be:

Gun_Railgun.tex.png

the game will not find it. the png is the ending determening format. it would have to look for a graphic named Gun_Railgun.tex to find it. this would be determined in the xml. what name the game is looking for.

the format of your files is usally determined when you save them with the imaging programm of your choice you dont have to add the ending in the name. so rename the texture to the above should fix it. or you should edit your xml texture path to Gun_Railgun.tex in the xml. but i think the xml's dont take names with points in it. usally using the underscores like you.

as for using .tex. have only seen people using the png's in mods. haven't tried if the game takes the tex ending. but just try it out. yoou will have to change the file format for this from png to tex.

Azoth

Thank guys for the help! I have it figured out now thanks to both of you, and as I thought it was something stupid I should have managed to figure out on my own haha. For some reason it never occurred to me to remove the .tex from the texture's name. This is what I get for following the advice of a year old reddit post >_<

Thanks again everyone, sorry for not being smart  :-[

kaptain_kavern

No problems.

And I don't find reading tutorials is un-smart ;-) even with an outdate ones i'm sure you actually learn some things ;P