Tips for making textures

Started by WolfgangPolska, October 24, 2018, 11:10:27 AM

Previous topic - Next topic

WolfgangPolska

Guys do you have any tips on making texutres for things? I mean mostly items and workshops, despite proper texture path my mods wont load them and I get the "unity2d.engine could not  load textures for XXX". What factors to consider and how i should be naming the files?
I have no idea how, but it works!!!

BukTaki

I ran into a problem like that i was not sure about the file structure. i had to compare the mods and and my own structure.

My structure for a shield mod is

Texture/Things/Item/Equipment/Apparel/Accessory/Shield/KiteShield/kiteshield

but the xml reference is.
<texPath>Things/Item/Equipment/Apparel/Accessory/Shield/KiteShield/kiteshield</texPath>

kite shield is the texture and Texture is implied so it does not need listed in the xml.

hope this helps


WolfgangPolska

I'm afraid I cant quite understand what do you mean.
I'm struggling with assigning  textures for workshops from my mod
I have no idea how, but it works!!!

BukTaki

I must have misunderstood the problem you are having.
a few questions
Do you have a texture?
Did you define the workshop?
If so in the workshops def.xml there should be a <graphicData>  </graphicData> section in there should be a <textPath> </textPath> line this is were you define the texture path for the workshop you are defining if you want to reuse an already existing texture say the butcher table you put.

<graphicData>
     <textPath>Things/Building/Production/TableButcher</textPath>
</graphicData>

In my own mod i have ancient shields the medium one is AncientMediumWoodenShield.png i made it Gimp 2.0 awesome program.

in the Def its


<graphicData>
<texPath>Things/Item/Equipment/Apparel/Accessory/Shield/Neolithic/AncientMediumWoodenShield</texPath>
<graphicClass>Graphic_Single</graphicClass>
</graphicData>


The path is much longer than it probably should be though.

If you're asking how i made the Texture.  i suck at art
I just googled ancient wooden shield. opened it in gimp.
turned it black and white. using balance and saturation.
i then upped the contrast and shrunk it down to proper size.

I am making an ancient smelter mod also.
so what i did for that was googled reference material and saved them as different layers in gimp. I then did one item at a time in a different layer. for example i made ingot mold, poker, brand, the table in its own layer then did the shadowing by itself.

I hope this helps.


















N7Huntsman

Did you find your answer for this?

As far as the "unity2d.engine could not  load textures for..." in my experience that means you have a pathing problem.

Broadly speaking, all the textures in your mod should be contained within the 'Textures' folder of your mod, or one of the subfolders therein. Within your .xml, using the <texPath></texPath> tags, you'll then point the .xml to the texture (spelling and capitalization are important here).

So, if the texture I wanted was called, Table.png and the file path to it was: MyTableMod>Textures>Furniture, my texPath would be:

<texPath>Furniture/Table</texPath>
The Rim is a cruel place.

WolfgangPolska

Yeah i have those defined, but i'm struggling to find out how to name different sides
I have no idea how, but it works!!!

N7Huntsman

What is is exactly that you're making? A piece of furniture? Apparel?
The Rim is a cruel place.

WolfgangPolska

Quote from: N7Huntsman on October 28, 2018, 02:27:45 PM
What is is exactly that you're making? A piece of furniture? Apparel?

I'm making a workshop, a something one could call a mining node.
I have no idea how, but it works!!!

BukTaki

Oh snap i got you in the xml in graphics data


    <graphicData>
      <texPath>Things/Building/Furniture/Bed/SleepSpot</texPath>
      <graphicClass>Graphic_Multi</graphicClass>
      <drawSize>(3,4)</drawSize>
    </graphicData


then when set up textures you would do Sleepspot_n for north _e for east facing or something like that.

WolfgangPolska

Despite fixing the texpath, and changing the graphic type to GraphicSingle another error is still popping.
I can't figure out how the texutres work honestly. Is there a possibilty that the png file is the issue?
I have no idea how, but it works!!!

WolfgangPolska

Here is an error log when i try to place the workshop itself, game wont even let me do that.
RimWorld 1.0.2059 rev1005
Verse.Log:Message(String, Boolean)
RimWorld.VersionControl:LogVersionNumber()
Verse.Root:CheckGlobalInit()
Verse.Root:Start()
Verse.Root_Entry:Start()

Exception reading recipes_mining.xml as XML: System.Xml.XmlException: Document element did not appear.  Line 1, position 1.
  at Mono.Xml2.XmlTextReader.Read () [0x00000] in <filename unknown>:0
  at System.Xml.XmlTextReader.Read () [0x00000] in <filename unknown>:0
  at System.Xml.XmlDocument.ReadNodeCore (System.Xml.XmlReader reader) [0x00000] in <filename unknown>:0
  at System.Xml.XmlDocument.ReadNode (System.Xml.XmlReader reader) [0x00000] in <filename unknown>:0
  at System.Xml.XmlDocument.Load (System.Xml.XmlReader xmlReader) [0x00000] in <filename unknown>:0
  at System.Xml.XmlDocument.LoadXml (System.String xml) [0x00000] in <filename unknown>:0
  at Verse.LoadableXmlAsset..ctor (System.String name, System.String fullFolderPath, System.String contents) [0x00000] in <filename unknown>:0
Verse.Log:Warning(String, Boolean)
Verse.LoadableXmlAsset:.ctor(String, String, String)
Verse.<XmlAssetsInModFolder>c__Iterator0:MoveNext()
Verse.<LoadDefs>c__Iterator0:MoveNext()
System.Collections.Generic.List`1:AddEnumerable(IEnumerable`1)
System.Collections.Generic.List`1:AddRange(IEnumerable`1)
Verse.LoadedModManager:LoadModXML()
Verse.LoadedModManager:LoadAllActiveMods()
Verse.PlayDataLoader:DoPlayLoad()
Verse.PlayDataLoader:LoadAllPlayData(Boolean)
Verse.Root:<Start>m__1()
Verse.LongEventHandler:RunEventFromAnotherThread(Action)
Verse.LongEventHandler:<UpdateCurrentAsynchronousEvent>m__1()

D:\64 Bit\Mods\Rimworld ore processing mod\Defs\ThingDefs_Recipes/recipes_mining.xml: unknown parse failure
Verse.Log:Error(String, Boolean)
Verse.LoadedModManager:CombineIntoUnifiedXML(List`1, Dictionary`2)
Verse.LoadedModManager:LoadAllActiveMods()
Verse.PlayDataLoader:DoPlayLoad()
Verse.PlayDataLoader:LoadAllPlayData(Boolean)
Verse.Root:<Start>m__1()
Verse.LongEventHandler:RunEventFromAnotherThread(Action)
Verse.LongEventHandler:<UpdateCurrentAsynchronousEvent>m__1()

Could not find a type named Gsingle
Verse.Log:Error(String, Boolean)
Verse.ParseHelper:FromString(String, Type)
Verse.DirectXmlToObject:ObjectFromXml(XmlNode, Boolean)
System.Reflection.MonoMethod:InternalInvoke(Object, Object[], Exception&)
System.Reflection.MonoMethod:Invoke(Object, BindingFlags, Binder, Object[], CultureInfo)
System.Reflection.MethodBase:Invoke(Object, Object[])
Verse.DirectXmlToObject:ObjectFromXml(XmlNode, Boolean)
System.Reflection.MonoMethod:InternalInvoke(Object, Object[], Exception&)
System.Reflection.MonoMethod:Invoke(Object, BindingFlags, Binder, Object[], CultureInfo)
System.Reflection.MethodBase:Invoke(Object, Object[])
Verse.DirectXmlToObject:ObjectFromXml(XmlNode, Boolean)
System.Reflection.MonoMethod:InternalInvoke(Object, Object[], Exception&)
System.Reflection.MonoMethod:Invoke(Object, BindingFlags, Binder, Object[], CultureInfo)
System.Reflection.MethodBase:Invoke(Object, Object[])
Verse.DirectXmlLoader:DefFromNode(XmlNode, LoadableXmlAsset)
Verse.LoadedModManager:ParseAndProcessXML(XmlDocument, Dictionary`2)
Verse.LoadedModManager:LoadAllActiveMods()
Verse.PlayDataLoader:DoPlayLoad()
Verse.PlayDataLoader:LoadAllPlayData(Boolean)
Verse.Root:<Start>m__1()
Verse.LongEventHandler:RunEventFromAnotherThread(Action)
Verse.LongEventHandler:<UpdateCurrentAsynchronousEvent>m__1()

Attempt to use string thingdefs to refer to field thingDefs in type Verse.ThingFilter; xml tags are now case-sensitive. XML: <filter><thingdefs><li>CoalOre</li></thingdefs></filter>
Verse.Log:Error(String, Boolean)
Verse.DirectXmlToObject:GetFieldInfoForType(Type, String, XmlNode)
Verse.DirectXmlToObject:ObjectFromXml(XmlNode, Boolean)
System.Reflection.MonoMethod:InternalInvoke(Object, Object[], Exception&)
System.Reflection.MonoMethod:Invoke(Object, BindingFlags, Binder, Object[], CultureInfo)
System.Reflection.MethodBase:Invoke(Object, Object[])
Verse.DirectXmlToObject:ObjectFromXml(XmlNode, Boolean)
Verse.DirectXmlToObject:ListFromXml(XmlNode)
System.Reflection.MonoMethod:InternalInvoke(Object, Object[], Exception&)
System.Reflection.MonoMethod:Invoke(Object, BindingFlags, Binder, Object[], CultureInfo)
System.Reflection.MethodBase:Invoke(Object, Object[])
Verse.DirectXmlToObject:ObjectFromXml(XmlNode, Boolean)
System.Reflection.MonoMethod:InternalInvoke(Object, Object[], Exception&)
System.Reflection.MonoMethod:Invoke(Object, BindingFlags, Binder, Object[], CultureInfo)
System.Reflection.MethodBase:Invoke(Object, Object[])
Verse.DirectXmlToObject:ObjectFromXml(XmlNode, Boolean)
System.Reflection.MonoMethod:InternalInvoke(Object, Object[], Exception&)
System.Reflection.MonoMethod:Invoke(Object, BindingFlags, Binder, Object[], CultureInfo)
System.Reflection.MethodBase:Invoke(Object, Object[])
Verse.DirectXmlLoader:DefFromNode(XmlNode, LoadableXmlAsset)
Verse.LoadedModManager:ParseAndProcessXML(XmlDocument, Dictionary`2)
Verse.LoadedModManager:LoadAllActiveMods()
Verse.PlayDataLoader:DoPlayLoad()
Verse.PlayDataLoader:LoadAllPlayData(Boolean)
Verse.Root:<Start>m__1()
Verse.LongEventHandler:RunEventFromAnotherThread(Action)
Verse.LongEventHandler:<UpdateCurrentAsynchronousEvent>m__1()

Could not resolve cross-reference to Verse.RecipeDef named MineIron (wanter=recipes)
Verse.Log:Error(String, Boolean)
Verse.DirectXmlCrossRefLoader:TryResolveDef(String, FailMode, Object)
Verse.WantedRefForList`1:TryResolve(FailMode)
Verse.DirectXmlCrossRefLoader:ResolveAllWantedCrossReferences(FailMode)
Verse.PlayDataLoader:DoPlayLoad()
Verse.PlayDataLoader:LoadAllPlayData(Boolean)
Verse.Root:<Start>m__1()
Verse.LongEventHandler:RunEventFromAnotherThread(Action)
Verse.LongEventHandler:<UpdateCurrentAsynchronousEvent>m__1()

Cannot call ItemFromXmlFile with resolveCrossRefs=true while loading is already in progress.
Verse.Log:Error(String, Boolean)
Verse.DirectXmlLoader:ItemFromXmlFile(String, Boolean)
RimWorld.PlayerKnowledgeDatabase:ReloadAndRebind()
RimWorld.PlayerKnowledgeDatabase:.cctor()
Verse.PlayDataLoader:DoPlayLoad()
Verse.PlayDataLoader:DoPlayLoad()
Verse.PlayDataLoader:LoadAllPlayData(Boolean)
Verse.Root:<Start>m__1()
Verse.LongEventHandler:RunEventFromAnotherThread(Action)
Verse.LongEventHandler:<UpdateCurrentAsynchronousEvent>m__1()

Could not resolve cross-reference to Verse.RecipeDef named MineIron (wanter=recipes)
Verse.Log:Error(String, Boolean)
Verse.DirectXmlCrossRefLoader:TryResolveDef(String, FailMode, Object)
Verse.WantedRefForList`1:TryResolve(FailMode)
Verse.DirectXmlCrossRefLoader:ResolveAllWantedCrossReferences(FailMode)
Verse.DirectXmlLoader:ItemFromXmlFile(String, Boolean)
RimWorld.PlayerKnowledgeDatabase:ReloadAndRebind()
RimWorld.PlayerKnowledgeDatabase:.cctor()
Verse.PlayDataLoader:DoPlayLoad()
Verse.PlayDataLoader:DoPlayLoad()
Verse.PlayDataLoader:LoadAllPlayData(Boolean)
Verse.Root:<Start>m__1()
Verse.LongEventHandler:RunEventFromAnotherThread(Action)
Verse.LongEventHandler:<UpdateCurrentAsynchronousEvent>m__1()

Cannot call ItemFromXmlFile with resolveCrossRefs=true while loading is already in progress.
Verse.Log:Error(String, Boolean)
Verse.DirectXmlLoader:ItemFromXmlFile(String, Boolean)
RimWorld.PlayerKnowledgeDatabase:ReloadAndRebind()
Verse.PlayDataLoader:DoPlayLoad()
Verse.PlayDataLoader:LoadAllPlayData(Boolean)
Verse.Root:<Start>m__1()
Verse.LongEventHandler:RunEventFromAnotherThread(Action)
Verse.LongEventHandler:<UpdateCurrentAsynchronousEvent>m__1()

Could not resolve cross-reference to Verse.RecipeDef named MineIron (wanter=recipes)
Verse.Log:Error(String, Boolean)
Verse.DirectXmlCrossRefLoader:TryResolveDef(String, FailMode, Object)
Verse.WantedRefForList`1:TryResolve(FailMode)
Verse.DirectXmlCrossRefLoader:ResolveAllWantedCrossReferences(FailMode)
Verse.DirectXmlLoader:ItemFromXmlFile(String, Boolean)
RimWorld.PlayerKnowledgeDatabase:ReloadAndRebind()
Verse.PlayDataLoader:DoPlayLoad()
Verse.PlayDataLoader:LoadAllPlayData(Boolean)
Verse.Root:<Start>m__1()
Verse.LongEventHandler:RunEventFromAnotherThread(Action)
Verse.LongEventHandler:<UpdateCurrentAsynchronousEvent>m__1()

Config error in MiningNodeIron: graphicClass is null
Verse.Log:Error(String, Boolean)
Verse.DefDatabase`1:ErrorCheckAllDefs()
System.Reflection.MonoMethod:InternalInvoke(Object, Object[], Exception&)
System.Reflection.MonoMethod:Invoke(Object, BindingFlags, Binder, Object[], CultureInfo)
System.Reflection.MethodBase:Invoke(Object, Object[])
Verse.GenGeneric:InvokeStaticMethodOnGenericType(Type, Type, String)
Verse.PlayDataLoader:DoPlayLoad()
Verse.PlayDataLoader:LoadAllPlayData(Boolean)
Verse.Root:<Start>m__1()
Verse.LongEventHandler:RunEventFromAnotherThread(Action)
Verse.LongEventHandler:<UpdateCurrentAsynchronousEvent>m__1()

Config error in Blueprint_MiningNodeIron: graphicClass is null
Verse.Log:Error(String, Boolean)
Verse.DefDatabase`1:ErrorCheckAllDefs()
System.Reflection.MonoMethod:InternalInvoke(Object, Object[], Exception&)
System.Reflection.MonoMethod:Invoke(Object, BindingFlags, Binder, Object[], CultureInfo)
System.Reflection.MethodBase:Invoke(Object, Object[])
Verse.GenGeneric:InvokeStaticMethodOnGenericType(Type, Type, String)
Verse.PlayDataLoader:DoPlayLoad()
Verse.PlayDataLoader:LoadAllPlayData(Boolean)
Verse.Root:<Start>m__1()
Verse.LongEventHandler:RunEventFromAnotherThread(Action)
Verse.LongEventHandler:<UpdateCurrentAsynchronousEvent>m__1()

Cannot call ItemFromXmlFile with resolveCrossRefs=true while loading is already in progress.
Verse.Log:Error(String, Boolean)
Verse.DirectXmlLoader:ItemFromXmlFile(String, Boolean)
Verse.KeyPrefs:Init()
Verse.PlayDataLoader:DoPlayLoad()
Verse.PlayDataLoader:LoadAllPlayData(Boolean)
Verse.Root:<Start>m__1()
Verse.LongEventHandler:RunEventFromAnotherThread(Action)
Verse.LongEventHandler:<UpdateCurrentAsynchronousEvent>m__1()

Could not resolve cross-reference to Verse.RecipeDef named MineIron (wanter=recipes)
Verse.Log:Error(String, Boolean)
Verse.DirectXmlCrossRefLoader:TryResolveDef(String, FailMode, Object)
Verse.WantedRefForList`1:TryResolve(FailMode)
Verse.DirectXmlCrossRefLoader:ResolveAllWantedCrossReferences(FailMode)
Verse.DirectXmlLoader:ItemFromXmlFile(String, Boolean)
Verse.KeyPrefs:Init()
Verse.PlayDataLoader:DoPlayLoad()
Verse.PlayDataLoader:LoadAllPlayData(Boolean)
Verse.Root:<Start>m__1()
Verse.LongEventHandler:RunEventFromAnotherThread(Action)
Verse.LongEventHandler:<UpdateCurrentAsynchronousEvent>m__1()

Initializing new game with mods Core, Rimworld ore processing mod
Verse.Log:Message(String, Boolean)
Verse.Game:InitNewGame()
Verse.Root_Play:<Start>m__1()
Verse.LongEventHandler:RunEventFromAnotherThread(Action)
Verse.LongEventHandler:<UpdateCurrentAsynchronousEvent>m__1()

Exception in UIRootUpdate: System.NullReferenceException: Object reference not set to an instance of an object
  at Verse.GhostUtility.GhostGraphicFor (Verse.Graphic baseGraphic, Verse.ThingDef thingDef, Color ghostCol) [0x00000] in <filename unknown>:0
  at Verse.GhostDrawer.DrawGhostThing (IntVec3 center, Rot4 rot, Verse.ThingDef thingDef, Verse.Graphic baseGraphic, Color ghostCol, AltitudeLayer drawAltitude) [0x00000] in <filename unknown>:0
  at RimWorld.Designator_Place.DrawGhost (Color ghostCol) [0x00000] in <filename unknown>:0
  at RimWorld.Designator_Place.SelectedUpdate () [0x00000] in <filename unknown>:0
  at RimWorld.Designator_Build.SelectedUpdate () [0x00000] in <filename unknown>:0
  at Verse.DesignatorManager.DesignatorManagerUpdate () [0x00000] in <filename unknown>:0
  at RimWorld.MapInterface.MapInterfaceUpdate () [0x00000] in <filename unknown>:0
  at RimWorld.UIRoot_Play.UIRootUpdate () [0x00000] in <filename unknown>:0
Verse.Log:Error(String, Boolean)
RimWorld.UIRoot_Play:UIRootUpdate()
Verse.Root:Update()
Verse.Root_Play:Update()
I have no idea how, but it works!!!

N7Huntsman

Can you upload the mod itself somewhere so people can glance through it and try to troubleshoot it? If you're doing something as simple as workshop and you're throwing that many errors, you've probably got at least a few significant formatting errors people are going to struggle to guess at from the errors alone.
The Rim is a cruel place.

WolfgangPolska

Quote from: N7Huntsman on November 14, 2018, 07:03:37 PM
Can you upload the mod itself somewhere so people can glance through it and try to troubleshoot it? If you're doing something as simple as workshop and you're throwing that many errors, you've probably got at least a few significant formatting errors people are going to struggle to guess at from the errors alone.
Yeah, here it is, it is very much WIP, since I have been unable to make textures I have put my attention elsewhere for a while.
https://drive.google.com/open?id=1DkJqcAeCRKArWFsQN2bxVjLsH2tqcwMl

[attachment deleted due to age]
I have no idea how, but it works!!!

LWM

It's possible the system is attempting to read the XML in the (empty) file recipes_mining.xml....and it's failing because it's not valid xml.  ...apparently a completely empty document isn't valid?

Try removing that file and see if it works!

--LWM

WolfgangPolska

Apparently the issue was indeed in textpath, so therefore it is fixed now.
I have no idea how, but it works!!!