[SOLVED] Custom Apparel Stat Def Question

Started by O Negative, March 08, 2020, 06:11:10 PM

Previous topic - Next topic

O Negative

Hi,

I'm looking to make a custom apparel stat def, but it isn't working properly. Am I missing something?

XML

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

  <StatDef>
    <defName>customStatDef</defName>
    <label>custom stat def</label>
    <description>The ability of this equipment to prevent healthy individuals from getting sick.</description>
    <category>Apparel</category>
    <defaultBaseValue>0</defaultBaseValue>
    <minValue>0</minValue>
<toStringStyle>PercentZero</toStringStyle>
    <showOnPawns>true</showOnPawns>
<parts>
      <li Class="StatPart_Quality">
        <factorAwful>0.2</factorAwful>
        <factorPoor>0.5</factorPoor>
        <factorNormal>1</factorNormal>
        <factorGood>1.1</factorGood>
        <factorExcellent>1.2</factorExcellent>
        <factorMasterwork>1.3</factorMasterwork>
        <factorLegendary>1.4</factorLegendary>
      </li>
    </parts>
    <displayPriorityInCategory>501</displayPriorityInCategory>
  </StatDef>

</Defs>



<?xml version="1.0" encoding="utf-8" ?>
<Defs>
  <ThingDef ParentName="ApparelMakeableBase">
    <defName>Apparel_CollarShirt</defName>
    <description>A nice-looking collared shirt with buttons.</description>
    <label>button-down shirt</label>
    <snip>
    <statBases>
      <MaxHitPoints>100</MaxHitPoints>
      <WorkToMake>2700</WorkToMake>
      <Mass>0.3</Mass>
      <customStatDef>500</customStatDef>
      <StuffEffectMultiplierArmor>0.2</StuffEffectMultiplierArmor>
      <StuffEffectMultiplierInsulation_Cold>0.26</StuffEffectMultiplierInsulation_Cold>
      <StuffEffectMultiplierInsulation_Heat>0.10</StuffEffectMultiplierInsulation_Heat>
      <EquipDelay>1.5</EquipDelay>
    </statBases>
    <snip>
  </ThingDef>
 


In the game, the apparel will show this customStatDef with the appropriate percentage. However, when you access the pawn's stats through the information panel, it shows 0%. How do I get this to update in the pawn's information panel?

Any help is greatly appreciated.

O Negative

Solved on Discord. Mods, please delete :)