Ludeon Forums

RimWorld => Mods => Help => Topic started by: jabbamonkey on April 18, 2021, 08:14:11 AM

Title: Masking Edit in mod causes errors for some people (and RED X)
Post by: jabbamonkey on April 18, 2021, 08:14:11 AM
I created some updated WORKBENCHES in a mod, and this required editing the Def for the masking. One person said they are getting an error and seeing a red X for a workbench. I think this may be an issue with conflicting mods that affect the workbenches I edited. Can someone help me fix the code, so it overrides other mods (my knowledge of XML is VERY limited) .....

Here are the two error messages...
Quote1)
XML error: Duplicate XML node name shaderType in this XML block: <graphicData><texPath>Things/Building/Production/TableTailorHand</texPath>

2)
XML Verse.GraphicData defines the same field twice: shaderType.
Field contents: CutoutComplex.
Whole XML:
<graphicData><texPath>Things/Building/Production/TableTailorHand</texPath>

Here is an example of the modified workbench code:
<li Class="patchOperationAdd">
<success>Always</success>
<xpath>*/ThingDef[defName = "HandTailoringBench"]/graphicData</xpath>
<value>
<shaderType>CutoutComplex</shaderType>
</value>
</li>


Note: I  know the image path is correct, and I am not receiving errors on my end. Also, the user didn't provide their log, so I don't know what mods could be affecting this.
Title: Re: Masking Edit in mod causes errors for some people (and RED X)
Post by: Shinzy on April 20, 2021, 07:27:52 AM
Looking at the hand tailoring bench; it already has the cutout complex shader type you're adding with the patch
It's possible the hand tailoring bench didn't have a shader type back when you first made this mod, but there seems to be one now

the error is complaining about duplicate of the thing you're adding with the patch, so I think you could actually even just get rid of the patch entirely

I do find it really strange that you're not seeing the error yourself!
have you got dev mode enabled? Some errors don't get shown without it
Title: Re: Masking Edit in mod causes errors for some people (and RED X)
Post by: jabbamonkey on April 20, 2021, 08:55:23 AM
Well, I tend to use Gloomy's Production/Furniture mods AFTER my mod, and they replace the TailorBench as well. So, I am assuming that their TailorBench code OVERRIDES mine....

Yup, just removed Gloomy's mods and the error showed up on my game load. I'll just remove the code from my mod. Thanks!
Title: Re: Masking Edit in mod causes errors for some people (and RED X)
Post by: Shinzy on April 20, 2021, 10:27:22 AM
Oooh! in this case you could also make one of them sequence operations to test if the shader exists and if not then add one.. But I have to admit, it might just not be worth the time and effort and headache. Have to draw the line somewhere :P
Title: Re: Masking Edit in mod causes errors for some people (and RED X)
Post by: jabbamonkey on April 20, 2021, 02:27:11 PM
I sort of WANT to do that, to make the mod as good as possible ... BUT, I also don't want to do that, because I'll be "pulling out my hair" trying to figure it HOW to do it.
:)
Title: Re: Masking Edit in mod causes errors for some people (and RED X)
Post by: Fakeaccount123 on April 20, 2021, 07:48:40 PM
did you try "PatchOperationReplace" instead of add? it seems like you are trying to add somethig that is already there. Why don't you replace it instead?
Title: Re: Masking Edit in mod causes errors for some people (and RED X)
Post by: jabbamonkey on April 22, 2021, 12:03:49 AM
Checking to see if something is there first, is a safe thing to do (and avoids issues in the future).

I can JUST REPLACE ... then I'd get an error if it doesn't exist.

If I JUST ADD, then I'd get an error if it does exist already.