Hello,
I'm having a problem with a new mod that I'm trying to make. Some of the textures load just fine, but others give an error saying they could not be loaded when launching the game. They are standard 64x64 pixel PNG format, 32 bit depth.
Seems that the XMLs are finding them, since changing the paths cause additional errors of not being able to find them. But when they are correctly pathed in the XMLs the error pops up for certain specific textures like on my custom plant.
I've attached what it looks like with the exception. Any ideas what the problem is?
[attachment deleted by admin - too old]
How did you set up your mod's directories?
Make sure it matches what's in the log.
Hmm.. maybe it is the code. I have no idea. The error goes away if I remove this code..... but that also completely disables the modification that the texture is being used in.
<ThingDef ParentName="PlantBase">
<defName>PlantNanithe</defName>
<label>nanithe</label>
<description>Yields nanithe fibre.</description>
<statBases>
<MaxHitPoints>125</MaxHitPoints>
<Beauty>1</Beauty>
</statBases>
<graphicData>
<texPath>Things/Plant/NanithePlant</texPath>
<graphicClass>Graphic_Random</graphicClass>
</graphicData>
<selectable>true</selectable>
<pathCost>10</pathCost>
<plant>
<dieIfLeafless>true</dieIfLeafless>
<shootsSeeds>false</shootsSeeds>
<harvestTag>Standard</harvestTag>
<harvestedThingDef>NanitheFibre</harvestedThingDef>
<harvestDestroys>true</harvestDestroys>
<harvestYield>20</harvestYield>
<sowTags>
<li>Ground</li>
</sowTags>
<sowMinSkill>10</sowMinSkill>
<topWindExposure>0.1</topWindExposure>
<growDays>4</growDays>
<fertilityFactorGrowthRate>0.4</fertilityFactorGrowthRate>
<visualSizeRange>
<min>0.3</min>
<max>1.05</max>
</visualSizeRange>
</plant>
</ThingDef>
What does your file structure look like? Specifically your /Mods/MyMod/Textures directory?
Make sure all your textures are inside of the Textures directory and your references don't include the base Textures directory name.
Quote from: Mackenzie on August 08, 2016, 04:07:21 PM
Hmm.. maybe it is the code. I have no idea. The error goes away if I remove this code..... but that also completely disables the modification that the texture is being used in.
It's probably this line:
<texPath>Things/Plant/NanithePlant</texPath>
Make a folder in your mods folder that is called
Textures
then put your NanithePlant.png into the folder. Then change that line of code to:
<texPath>NanithePlant</texPath>
AFAIK in terms of textures you add to the game, texPath refers to the Textures folder in the mod folder. If you want to further organize your mod's textures with folders you can do so like this:
<texPath>NameOfFolderInTexturesFolder/NanithePlant</texPath>
Quote from: 1000101 on August 08, 2016, 05:21:32 PM
What does your file structure look like? Specifically your /Mods/MyMod/Textures directory?
Make sure all your textures are inside of the Textures directory and your references don't include the base Textures directory name.
Well it's definitely not a path issue. /Mods/MyMod/Textures/Things/Plant/Image.png and that seems to be working... I fixed the issue and what the issue was, was not the <texPath> tag but the <graphicClass> tag... I had copied cotton plant as a blueprint of code to work from so to speak and it uses Graphic_Random as the value of the tag... apparently that throws the error as apparently my custom images don't like using that class so I tried what the other plants are using, which is Graphic_Single and it all works perfectly fine now.
I appreciate the time and help anyone put forth. If anyone wanted to explain what the graphicClass tag actually does in function, I would be appreciative.
Quote from: robotguy4 on August 08, 2016, 05:41:38 PM-snip-
I tried everything, for hours... trying different things with names and paths and slashes and what not but it just wouldn't work. See my previous post for the details. Thanks for trying to help me troubleshoot, friend. (: