Specifying age range?

Started by Ekarus, May 05, 2016, 08:53:35 PM

Previous topic - Next topic

Ekarus

Working on something that requires humanoids to, at most, get to be 30 years old. Problem is they keep generating between 40 to at most 60. Can anyone tell me what I need to know so I can get the age-range right?


  <ThingDef ParentName="BasePawn">
    <defName>SuperSoldier</defName>
    <label>super soldier</label>
    <description>This human was engineered from birth to be the perfect soldier. Every aspect of their being has been built around combat strength and survivability. As a side effect of their moddifications they do not live as long as a baseline human.</description>
    <uiIconPath>Things/Pawn/Humanlike/UI/IconHuman</uiIconPath>
    <statBases>
    <MarketValue>2500</MarketValue>
      <MoveSpeed>5.00</MoveSpeed>
      <Flammability>0.5</Flammability>
      <ComfyTemperatureMin>14</ComfyTemperatureMin>
      <ComfyTemperatureMax>42</ComfyTemperatureMax>
      <LeatherAmount>25</LeatherAmount>
    </statBases>
    <verbs>
      <li>
        <verbClass>Verb_MeleeAttack</verbClass>
        <defaultCooldownTicks>90</defaultCooldownTicks>
        <meleeDamageBaseAmount>8</meleeDamageBaseAmount>
        <meleeDamageDef>Blunt</meleeDamageDef>
        <linkedBodyPartsGroup>LeftHand</linkedBodyPartsGroup>
      </li>
      <li>
        <verbClass>Verb_MeleeAttack</verbClass>
        <defaultCooldownTicks>100</defaultCooldownTicks>
        <meleeDamageBaseAmount>8</meleeDamageBaseAmount>
        <meleeDamageDef>Blunt</meleeDamageDef>
        <linkedBodyPartsGroup>RightHand</linkedBodyPartsGroup>
      </li>
      <li>
        <verbClass>Verb_MeleeAttack</verbClass>
        <defaultCooldownTicks>100</defaultCooldownTicks>
        <meleeDamageBaseAmount>10</meleeDamageBaseAmount>
        <meleeDamageDef>Blunt</meleeDamageDef>
        <linkedBodyPartsGroup>UpperHead</linkedBodyPartsGroup>
      </li>
      <li>
        <verbClass>Verb_MeleeAttack</verbClass>
        <defaultCooldownTicks>120</defaultCooldownTicks>
        <meleeDamageBaseAmount>12</meleeDamageBaseAmount>
        <meleeDamageDef>Bite</meleeDamageDef>
        <linkedBodyPartsGroup>Teeth</linkedBodyPartsGroup>
      </li>
    </verbs>
    <race>
      <soundMeleeHitPawn>Pawn_Melee_Punch_HitPawn</soundMeleeHitPawn>
      <soundMeleeHitBuilding>Pawn_Melee_Punch_HitBuilding</soundMeleeHitBuilding>
      <soundMeleeMiss>Pawn_Melee_Punch_Miss</soundMeleeMiss>
      <specialshadowData>
        <volume>(0.3, 0.8, 0.4)</volume>
        <offset>(0,0,-0.3)</offset>
      </specialshadowData>
      <thinkTreeMain>Humanlike</thinkTreeMain>
      <thinkTreeConstant>HumanlikeConstant</thinkTreeConstant>
      <intelligence>Humanlike</intelligence>
      <makesFootprints>true</makesFootprints>
      <lifeExpectancy>30</lifeExpectancy>
      <leatherColor>(211,200,155)</leatherColor>
      <leatherCommonalityFactor>0.01</leatherCommonalityFactor>
      <leatherInsulation>1</leatherInsulation>
      <leatherMarketValue>18</leatherMarketValue>
      <nameCategory>HumanStandard</nameCategory>
      <minFoodPreferability>DesperateOnly</minFoodPreferability>
      <body>SuperSoldier</body>
      <baseBodySize>1.2</baseBodySize>
      <baseHealthScale>2.5</baseHealthScale>
      <foodType>OmnivoreHuman</foodType>
      <gestationPeriodDays>10</gestationPeriodDays>
      <ageGenerationCurve>
        <points>
          <li>
            <loc>(14,0)</loc>
          </li>
          <li>
            <loc>(16,100)</loc>
          </li>
          <li>
            <loc>(50,100)</loc>
          </li>
          <li>
            <loc>(60,30)</loc>
          </li>
          <li>
            <loc>(70,18)</loc>
          </li>
          <li>
            <loc>(80,10)</loc>
          </li>
          <li>
            <loc>(90,3)</loc>
          </li>
          <li>
            <loc>(100,0)</loc>
          </li>       
        </points>
      </ageGenerationCurve>
      <hediffGiverSets>
        <li>OrganicStandard</li>
<li>SurvivalGeneMods</li>
      </hediffGiverSets>
      <litterSizeCurve>
        <points>
          <li>(0.5, 0)</li>
          <li>(1, 1)</li>
          <li>(1.01, 0.02)</li>
          <li>(3.5, 0)</li>
        </points>
      </litterSizeCurve>
      <lifeStageAges>
        <li>
          <def>HumanlikeBaby</def>
          <minAge>0.1</minAge>
        </li>
        <li>
          <def>HumanlikeToddler</def>
          <minAge>0.5</minAge>
        </li>
        <li>
          <def>HumanlikeChild</def>
          <minAge>0.8</minAge>
        </li>
        <li>
          <def>HumanlikeTeenager</def>
          <minAge>1</minAge>
        </li>
        <li>
          <def>HumanlikeAdult</def>
          <minAge>10</minAge>
        </li>
      </lifeStageAges>
    </race>
    <recipes>
      <li>InstallPowerClaw</li>
      <li>InstallScytherBlade</li>
      <li>InstallBionicEye</li>
      <li>InstallBionicArm</li>
      <li>InstallBionicLeg</li>
      <li>InstallSimpleProstheticArm</li>
      <li>InstallSimpleProstheticLeg</li>
      <li>InstallPegLeg</li>
      <li>InstallDenture</li>
      <li>InstallJoywire</li>
      <li>InstallPainstopper</li>
      <li>InstallSnakeSkinCos</li>
      <li>InstallMoodScalesCos</li>
      <li>InstallCosFur</li>
      <li>InstallCosFeather</li>
      <li>InstallNaturalHeart</li>
      <li>InstallNaturalLung</li>
      <li>InstallNaturalKidney</li>
      <li>InstallNaturalLiver</li>
      <li>ExciseCarcinoma</li>
      <li>RemoveBodyPart</li>
      <li>Euthanize</li>
    </recipes>
  </ThingDef>


Gonna give up on being vague with what I'm working on, the "30 years old at most" part is (probably) a dead give away.

RawCode

try setting ageGenerationCurve to fixed value

RemingtonRyder

The values on the age generation curve are basically points on a graph of age (along bottom) versus chance of generation (along side).

This means that in order to get humans to usually die at 31, you need to discard these points:

(50, 100)
(60, 30)
(70, 18)
(80, 10)
(90, 3)
(100, 0)

and for example, add the following:

(29, 100)
(30, 3)
(31, 0)

Illusion Distort

Just remember to distribute it so that not all your colonists spawn as 29 yearolds (unless that's what you want) :D

Ekarus

Huge thanks to everyone, I got the help I needed so I'm gonna lock the topic.