Jump to content

Rimjobworld How do I change the pregnancy duration?


Recommended Posts

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.

Link to comment

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.

Link to comment
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!

Link to comment
  • 4 months later...
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.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more information, see our Privacy Policy & Terms of Use