[Help me pls] Unknown Parse Error [Help me pls]

Started by MaximalSchaden, October 30, 2019, 10:01:26 AM

Previous topic - Next topic

MaximalSchaden

Does Anyone see the problem with this Code??
------------------------------------------------------------------------------------------------------------------------------------------------------------------

<?xml version="1.0" encoding="utf-8" ?>
<Defs>

       <!-- ==================================== Infantry_Cap =====================================-->
 
   <ThingDef ParentName="HatMakeableBase">
    <defName>Apparel_Cap_M73</defName>
    <label>Cap M73</label>
    <description>A simple but Beautiful hat Worn By russian Troops during the Second World War.</description>
    <recipeMaker>
      <researchPrerequisite>ComplexClothing</researchPrerequisite>
    </recipeMaker>
    <graphicData>
      <texPath>Things/Apparel/Display/Cap_M73</texPath>
      <graphicClass>Graphic_Single</graphicClass>
    </graphicData>
    <costStuffCount>80</costStuffCount>
    <stuffCategories>
      <li>Fabric</li>
    </stuffCategories>
    <statBases>
      <WorkToMake>2000</WorkToMake>
      <Mass>0.14</Mass>
      <StuffEffectMultiplierArmor>0.2</StuffEffectMultiplierArmor>
      <StuffEffectMultiplierInsulation_Cold>0.10</StuffEffectMultiplierInsulation_Cold>
      <StuffEffectMultiplierInsulation_Heat>0.50</StuffEffectMultiplierInsulation_Heat>
      <EquipDelay>0.8</EquipDelay>
    </statBases>
    <equippedStatOffsets>
      <SocialImpact>0.10</SocialImpact>
    </equippedStatOffsets>
    <apparel>
      <bodyPartGroups>
        <li>UpperHead</li>
      </bodyPartGroups>
      <wornGraphicPath>Things/Apparel/Headgear/Cap_M73</wornGraphicPath>
      <layers>
        <li>Overhead</li>
      </layers>
      <tags>
        <li>IndustrialMilitaryBasic</li>
      </tags>
      <defaultOutfitTags>
        <li>Worker</li>
      </defaultOutfitTags>
    </apparel>
    <colorGenerator Class="ColorGenerator_Options">
      <options>
        <li>
          <weight>10</weight>
          <only>(0.9,0.54,0.15,1)</only>
        </li>
        <li>
          <weight>15</weight>
          <only>(0.9,0.6,0.18,1)</only>
        </li>
        <li>
          <weight>20</weight>
          <only>(0.9,0.42,0.23,1)</only>
        </li>
      </options>
    </colorGenerator>
  </ThingDef>
  </defs>
   

Pangaea

I'm not a modder so please excuse the somewhat wild stabs in the dark. There is the possible issue I mentioned in the other thread about vanilla abstracts. But other than that, would it help to simply add Abstract="True"

When I look at some other files, they use lines such as:
  <ThingDef Name="HatBase" ParentName="ApparelBase" Abstract="True">

LWM

"Abstract="true"" means that the ThingDef doesn't actually define an item, but rather a collection of xml tags that other things can share.  So an abstract "HatBase" would say things like "this is clothing" and "hey, you put this on your head."  So if you inherit (parent="HatBase") you don't have to do all typing (and possibly miss something).

Kirby23590

Hmmm...

Looking at everything, it seems right...

Does the unknown parse error appear, and does it not allow to spawn the cap? Or does it allow you to and gives you a weird pink X square box?

Well we gotta all double check for any typo in the xml code if it's is still not working and still giving unknown parse error.

One "happy family" in the rims...
Custom font made by Marnador.



MaximalSchaden

Well it does not show the item ingame at all, not even a pink box

Kirby23590

#5
I think... You have to change the Apparel_Cap_M73 to Apparel_Cap_MSeventyThree in the defName since i think the code doesn't like the defname having numbers.

The label is fine and you don't need to change the it, Keeping Cap M73 is fine... edit:fixed a bit of my grammar

But for the <texPath> and <wornGraphicPath> you gotta change Cap_M73 to Cap_MSeventyThree as well and also in the textures files.

I think that's why you're getting an unknown parse error.

One "happy family" in the rims...
Custom font made by Marnador.



LWM


diner

#7
Quote from: MaximalSchaden on October 30, 2019, 10:01:26 AM
Does Anyone see the problem with this Code??
---------------------------------------------------------------------------------------------------------------------------------------------------------
<?xml version="1.0" encoding="utf-8" ?>
  <Defs>
    ....
  </defs>
   

Yes, your defs tag at the end of your XML must be </Defs>

XML is case sensitive and you must match casing on all opening and closing tags.

A handy free utility for XML is XML Notepad ... https://github.com/microsoft/xmlnotepad




Kirby23590

Quote from: diner on October 31, 2019, 03:15:00 AM
Yes, your defs tag at the end of your XML must be </Defs>

XML is case sensitive and you must match casing on all opening and closing tags.

A handy free utility for XML is XML Notepad ... https://github.com/microsoft/xmlnotepad

Yup, there's a reason why it's case sensitive, and to tell you the truth, we had some of those problems in the past. And there's always a small lowercase or a typo in the code hiding...

Nice find diner... :D

One "happy family" in the rims...
Custom font made by Marnador.