Unknown Parse failure [Help me pls]

Started by MaximalSchaden, October 30, 2019, 06:59:33 AM

Previous topic - Next topic

MaximalSchaden

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

       <!-- ==================================== Infantry =====================================-->
 
  <ThingDef ParentName="HatMakeableBase">
    <defName>Apparel_Cap_M73</defName>
    <label>Cap M73</label>
    <description>Standard issued Cap given to RecruitInfantryMen</description>
   
    <recipeMaker>
      <researchPrerequisite>ComplexClothing</researchPrerequisite>
    </recipeMaker>
   
    <graphicData>
      <texPath>Things/Apparel/Display/Cap_M73/<texPath>
      <graphicClass>Graphic_Single</graphicClass>
      <shaderType>CutoutComplex</shaderType>
    </graphicData>
   
    <costStuffCount>25</costStuffCount>
    <stuffCategories>
      <li>Fabric</li>
      <li>Leathery</li>
    </stuffCategories>
   
    <statBases>
      <WorkToMake>2000</WorkToMake>
      <Mass>0.14</Mass>
      <ArmorRating_Blunt>0.04</ArmorRating_Blunt>
      <ArmorRating_Sharp>0.04</ArmorRating_Sharp>
      <Insulation_Heat>9</Insulation_Heat>
     <Insulation_Cold>4</Insulation_Cold>
    </statBases>
   
    <equippedStatOffsets>
      <SocialImpact>0.15</SocialImpact>
    </equippedStatOffsets>
   
    <apparel>
      <bodyPartGroups>
        <li>UpperHead</li>
      </bodyPartGroups>
      <wornGraphicPath>Things/Apparel/Headgear/Cap_M73</wornGraphicPath>
      <layers>
        <li>Overhead</li>
      </layers>
     
      <tags>
       <li>Cap_M73</li>
      </tags>
     
      <defaultOutfitTags>
        <li>Soldier</li>
      </defaultOutfitTags>
    </apparel>

    <thingCategories>
      <li>Cap_M73</li>
    </thingCategories>   
     </ThingDef>
    </Defs>
   

MaximalSchaden

Does anyone See a problem In this?

Kirby23590

Look at the Rimworld/Mods/Core/Defs/ThingDefs_Misc and Apparel_Headgear.xml and take a good look at it or copy a template like a cowboy hat or a simple helmet.

Though for the code, i think you should remove <shaderType> and <thingCategories> but unless you want to make a new type of category of items or clothes.

Also if you want your cap to appear with pawns from raiders or from traders. Replace <tags> with IndustrialMilitaryBasic so that it will show up with some pawns raiding you or give the pawns the Cap_M73 tag for them to be seen wearing them when raiding you.




Also out of topic but i think this should be moved to the Mod Help Forums.  ;)

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



Pangaea

#3
Isn't there something about NOT using the parent bases (HatMakeableBase), but instead create your own if you want to have the code like that?



Edit: Yes, think I found something about that :)

https://spdskatr.github.io/RWModdingResources/abstracts
QuoteClosing thoughts, random stuff

    DON'T FUCKING INCLUDE VANILLA BASE ABSTRACTS.

LWM

There's a lot of reason to use abstracts?  As long as you are correctly basing your thing off them, there's no problem, and they avoid more problem for me than they create!  I tend to miss little things when I don't base my things off abstracts, so I end up with a building with no texture or something...  The only part to remember is that if you don't want to inherit part of the tree from the parent (say, researchPrereqs), include <whicheverTag Inherit="false">

What sorts of errors are you seeing?  Just the generic "does not parse?"  You might consider commenting out half your thingdef and then seeing if it works - you're probably defining something that isn't in the thingDef?

--LWM

Kirby23590

#5
Probably, since the Unknown Parse failure error thing might say, hey that ain't in the code in the hat.

Also in that tutorial very, old? I did read some of it, and use it to learn how to make mods.

Don't know but using HatMakeableBase seems fine, as long you don't dun goof it and something explodes and goes awfully wrong and barrages you with a red wall of text... I don't know if you have some knowledge about making mods Pangaea, but as LONG IT'S WEAPONS USING YOUR OWN PARENT BASES THAT YOU MADE. but i think hats are A-okay, sorry for caps.

You can of course replace the copied template of the cowboy hat and remove HatMakeableBase and use your own custom Parentbase, though i think that's advanced for MaximalSchaden. :P

EDIT: Well we all gotta go to https://ludeon.com/forums/index.php?topic=49754.msg466369#new if you want to help out a newbie modder there in need.

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



Pangaea

Haven't made any mods for this game, Kirby, so I don't know terribly much about it. I based my post on the linked tutorial, and having seen that point made elsewhere as well. Hence why I went looking for it.

It's not the abstract itself that is the problem, based on what that tutorial says, but using (altering?) the vanilla abstract. Of course, I could be talking out my arse here, especially if that tutorial is wrong or outdated. But in any case, here is what it says in more detail:

QuoteYou can inherit from this, but DON'T copy it over in your mod or otherwise include it. If you inherit from it (use it as a parent) you use it. If you copy-paste that over in your mod, you cause incompatibilities with other mods. Why? Because other mods inherit from it, and when there are two versions of the Abstract to inherit from, things go bad.

Of course, this may have nothing to do with this error, and it can be something entirely different. Probably best I just take my coat and leave :D

Kirby23590

Well looking at it, it's made 2 years ago... But it's still relevant, some of it...

Well the abstract nor the parentbase doesn't have anything to do with MaximalSchaden's mod on the unknown parse failure.
So gotta grab a hat from a closet and a jacket and take a walk and leave as well...  ;D

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