Failed to find any texture Error

Started by Orion, October 02, 2015, 01:42:09 PM

Previous topic - Next topic

Orion

Hello fellow modders,

sometimes, when spawning a big raid of my custom pawns, I get Failed to find any texture while constructing Multi(initPath=UI/Misc/BadTexture, ...). All spawned pawns have correct textures and from what I can tell their weapons too. I've triple and quadruple checked their texture path and it all seems in order. How would I go about tracking down the cause of this error?

Did anyone have this problem before?

BBream

#1
Did you check not only Race_CustomPawn but also PawnKindDef?
initPath=UI/Misc/BadTexture means its path didn't set.

Orion

I did check PawnKindDef. What is Race_CustomPawn?

BBream

I thought your custom pawn has their own race so they might have race def.
Or somewhere it has wrong graphic type that should be graphic_single but not graphic_multi. For checking, please give me more information.

Orion

It does! Although I don't have a graphic set there (maybe the problem?).

Thanks for helping me, I don't know what information I can give you, so I think I can better let you look at the defs: https://www.dropbox.com/sh/x4f6t7qd5nwbuwa/AAC4gVgkscVAXkrvfAYOlVz2a?dl=0

Oh, maybe it also helps to know that in previous alphas it worked fine (unless I accidentally broke something).

BBream

All I found is:
In Weapon_Gun.xml, MechanoidFlameThrower, BoomBoom and MechanoidBoom have "Hidden" texPath.


Orion

Hidden is actually a texture... But I'll have to check if it's set up right. Maybe this is the one!

Orion

Okay, I replaced Hidden with a built in texture. Didn't make a difference... also, those are all "Single", and the error is thrown in Multi. Too bad.

BBream

This error message is started from:
In Graphic_Multi:

    public override void Init(GraphicRequest req)
    {
      this.path = req.path;
      this.color = req.color;
      this.colorTwo = req.colorTwo;
      this.drawSize = req.drawSize;
      Texture2D[] texture2DArray1 = new Texture2D[3];
      texture2DArray1[0] = ContentFinder<Texture2D>.Get(req.path + "_back", false);
      if ((UnityEngine.Object) texture2DArray1[0] == (UnityEngine.Object) null)
      {
        Log.Error("Failed to find any texture while constructing " + this.ToString());
      }
...

Orion

Indeed. Unfortunately it doesn't tell which object is causing it, and I also can't change the message to provide more information... I could possibly inherit Graphic_Multi, but since I don't know which object is the offender, I can't inject it.

BBream

I have good idea for debugging. Put debug texture named "BadTexture_back.png" in Texture/UI/Misc. Then it will show which one has problem if it is spawned.

Orion

Interesting idea! I'll try and see what happens :)

Orion

Hm. It supresses the error message, but no object shows up with the texture.

BBream

Quote from: Orion on October 12, 2015, 08:09:07 AM
Hm. It supresses the error message, but no object shows up with the texture.
Oh I thought this would be worked.
Did you make other texture named BadTexture_side.png, BadTexture_front.png?

Orion

No, but it didn't complain about not finding them either...