Jump to content

Rimjobworld How do I change the pregnancy duration?


shann_

Recommended Posts

Posted

I felt like the pregnancy duration is a little long, I tried changing it from the mod's code but since I am an average person with 0 programming experience, I just managed to give myself a headache. Help would be appreciated.

Posted

I haven't tested it, but I assume you only need to change the gestationPeriodDays property of whatever race you want to change:

 

Humans:

<?xml version="1.0" encoding="utf-8" ?>
<Patch>
  <Operation Class="PatchOperationSequence">
    <success>Normal</success>
    <operations>
      <li Class="PatchOperationReplace">
        <xpath>/Defs/ThingDef[defName="Human"]/race/gestationPeriodDays</xpath>
        <value>
          <gestationPeriodDays>45</gestationPeriodDays> <!-- change this number -->
        </value>
      </li>
    </operations>
  </Operation>
</Patch>

 

"BasePawn" - not sure what this entails, definitely humans, very likely other playable races, but don't know about animals. Animals probably require other patches.

<?xml version="1.0" encoding="utf-8" ?>
<Patch>
  <Operation Class="PatchOperationSequence">
    <success>Normal</success>
    <operations>
      <li Class="PatchOperationReplace">
        <xpath>/Defs/ThingDef[@ParentName="BasePawn"]/race/gestationPeriodDays</xpath>
        <value>
          <gestationPeriodDays>45</gestationPeriodDays> <!-- change this number -->
        </value>
      </li>
    </operations>
  </Operation>
</Patch>

 

 

Also it's not necessary to make it a PatchOperationSequence if you only do one patch but meh.

 

Further reading:

https://www.rimworldwiki.com/wiki/Modding_Tutorials/XML_file_structure

https://www.rimworldwiki.com/wiki/Modding_Tutorials/PatchOperations

 

So far, no C# or compiling required.

Posted
4 hours ago, nugerumon said:

I haven't tested it, but I assume you only need to change the gestationPeriodDays property of whatever race you want to change:

 

Humans:


<?xml version="1.0" encoding="utf-8" ?>
<Patch>
  <Operation Class="PatchOperationSequence">
    <success>Normal</success>
    <operations>
      <li Class="PatchOperationReplace">
        <xpath>/Defs/ThingDef[defName="Human"]/race/gestationPeriodDays</xpath>
        <value>
          <gestationPeriodDays>45</gestationPeriodDays> <!-- change this number -->
        </value>
      </li>
    </operations>
  </Operation>
</Patch>

 

"BasePawn" - not sure what this entails, definitely humans, very likely other playable races, but don't know about animals. Animals probably require other patches.


<?xml version="1.0" encoding="utf-8" ?>
<Patch>
  <Operation Class="PatchOperationSequence">
    <success>Normal</success>
    <operations>
      <li Class="PatchOperationReplace">
        <xpath>/Defs/ThingDef[@ParentName="BasePawn"]/race/gestationPeriodDays</xpath>
        <value>
          <gestationPeriodDays>45</gestationPeriodDays> <!-- change this number -->
        </value>
      </li>
    </operations>
  </Operation>
</Patch>

 

 

Also it's not necessary to make it a PatchOperationSequence if you only do one patch but meh.

 

Further reading:

https://www.rimworldwiki.com/wiki/Modding_Tutorials/XML_file_structure

https://www.rimworldwiki.com/wiki/Modding_Tutorials/PatchOperations

 

So far, no C# or compiling required.

You're a life saver! Thank you!

  • 4 months later...
Posted
13 minutes ago, dantman12321 said:

sorry if its obvious and im just blind but what file is this in as i searched though the files but couldn't find anything thank you in advance

You have to put it in your own file.

 

Mini-Tutorial (of sorts - I'm sure there are better to be found):

In your mod directory, make a new folder for your mod. In that folder make two folders: "About" and "Patches"

In the "About" folder, you need an "About.xml" - probably easiest to copy one from another mod and edit all the things.

In the "Patches" folder, make a new file, name it anything you want (just make sure it ends in ".xml") and paste whatever patch operation you want. See above for examples and refer to the wiki (and original Rimworld Defs) for more information.

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...