Race wide pain factor reduction?

Started by AtomicRavioli, August 20, 2016, 06:44:25 AM

Previous topic - Next topic

AtomicRavioli

I recently switched pawns from my mod from having a Mechanoid flesh type to the normal one (Having a mechanoid flesh type tied in some really strange idiosyncrasies, like having pawns with the flesh type spawn from toxic/psychic ships). This however caused a problem with some of these pawns having pain related issues that reduced their combat viability drastically.

I want to somehow apply a .2 pain factor to the races, but I can't seem to figure it out, aside from giving them all a permanent hediff (This feels really sloppy, unless there is a way to make it invisible).

Is there any way to reduce pain for a race?

CallMeDio

I think you can make a invisible hediff, you can use <everVisible>false</everVisible>, notice that it is a tag of hediff stages it has to be in a stage, take a look at hediff alcohol to see it in action. To make a hediff permanently invisible you can set a initial severity that makes the hediff be on the stage with the everVisible false and do a
<li>
        <compClass>HediffComp_Immunizable</compClass>
        <severityPerDayNotImmune>0</severityPerDayNotImmune>
      </li>


I believe this will be able to make a eternal invisible hediff. (not tested), but it is worth a try don't you think?  ;)
Cheers
QuoteYou may need a rubber duck.  Also, try some caveman debugging.

Released mods: No Mood Loss on Prisoner Sold or Died

AtomicRavioli

Quote from: CallMeDio on August 27, 2016, 11:35:53 PM
I think you can make a invisible hediff, you can use <everVisible>false</everVisible>, notice that it is a tag of hediff stages it has to be in a stage, take a look at hediff alcohol to see it in action. To make a hediff permanently invisible you can set a initial severity that makes the hediff be on the stage with the everVisible false and do a
<li>
        <compClass>HediffComp_Immunizable</compClass>
        <severityPerDayNotImmune>0</severityPerDayNotImmune>
      </li>


I believe this will be able to make a eternal invisible hediff. (not tested), but it is worth a try don't you think?  ;)
Cheers

Making a permanent hediff is exactly what I did, I will try to see if I can make it invisible with that tag.

As for making it permanent, I just put it in a GiverSetDef with a 100% chance to get it at birth.
These are the xmls for the passive if anyone wants to use it (you could use it to apply any sort of passive):
<Defs>

  <HediffDef Name="CrystalPassiveBase" Abstract="True">
    <hediffClass>HediffWithComps</hediffClass>
    <defaultLabelColor>(0.66, 0.6, 0.84)</defaultLabelColor>
    <isBad>false</isBad>
  </HediffDef>
 

<HediffDef ParentName="CrystalPassiveBase">
<defName>CrystalBehemoth</defName>
<label>Behemoth Constitution</label>
<stages>
<li>
<painFactor>0.2</painFactor>
</li>
</stages>
</HediffDef>

</Defs>


The hediffGiverSetDef to apply it:

  <HediffGiverSetDef>
    <defName>CrystalColossusPassive</defName>
    <hediffGivers>
 
      <li Class="HediffGiver_Birthday">
        <hediff>CrystalBehemoth</hediff>
        <ageFractionChanceCurve>
          <points>
            <li>(0, 1)</li>
            <li>(1, 1)</li>
          </points>
        </ageFractionChanceCurve>
      </li>

    </hediffGivers>
  </HediffGiverSetDef>


(I also found out that a creature's health scale increase pain tolerance, but fiddling with that involves horribly tedious amounts of rewriting values for HP in body part defs, testing, and repeating until it is set just right)