RimWorld

RimWorld

40 ratings
Random Spawning Genes
   
Award
Favorite
Favorited
Unfavorite
Mod, 1.5, 1.6
File Size
Posted
Updated
265.025 KB
Mar 2 @ 12:32pm
Jun 24 @ 1:44pm
14 Change Notes ( view )
You need DLC to use this item.

Subscribe to download
Random Spawning Genes

Description
Random spawning genes!

So many mods add genes and only so many are on pawns. I wanted more variety on them and didn't like the current options available.

This mod will make all pawns spawn with an additional random assortment of genes.
In order to prevent a bunch of pawns spawning with extremely high or low metabolism, this uses a "super advanced AI logic" to try and get to the metabolism requested by the player.

Genes added can be a consistent amount (for example 4) or a random range between two numbers (from 0~64). There are options for where genes are placed, and what to do with genes that have prerequisites. The first gene given will be entirely random to throw some variation into the mix. Subsequent genes added will try to reach the ideal metabolism provided. When at or near this metabolism (±1), random single metabolism or zero metabolism (as set in the options) genes will be added.

You can provide a filter that will exclude any genes that contain the same defname as provided in the text box. There is an option to add in recomended exclusions. These are genes that would automatically down or otherwise incapacitate a pawn on spawn. A longer, more in-depth list is also provided in the about folder "PossibleExclusions.xml", containing the reason these genes are on this list.
Note these filters are case sensitive.
Babies - Babies can be given genes as well. However there is an option to turn this setting off.

Compatibility
For modders: There is a def included in this mod that you can patch to exclude your genes from appearing. This can be done through single genes, exclusionTags, or the intire mod itself. There are example patches included in the About folder.
Big and small framework: If a gene has prerequisites from using this framework, they will be taken into account with adding genes.
HAR: Genes should only be added if the race allows it. This works in both directions
VRE Insectors & VRE Androids: This will not use custom "genes" from these mods or any other mods that subclass Genedefs.
Androids will not be given genes.
Insectors can still receive genes.

Errors
I've tried testing this with a couple hundred gene mods. Sent some errors in compatibility of certain genes to their respective authors in the process as well. However I obviously can't guarantee every gene mod works with every other gene. There are options in the mod to turn on logging so you can determine what combination of genes are causing errors and report it to their mod authors. Additionally, be sure to check "PossibleExclusions.xml" located in the about folder for genes that may cause issue.
If there is an error with my mod specifically, please provide me a Hugs Log so I can fix the issue.

Credits
RimWorld discord for helping me learn how to make a UI and not just cry in a corner (thanks Telardo and Arquebus!).
Steve who made my code look less ugly.
Redmattis who let me steal the code he uses for big and small better prerequisites so I could write my compatibility with it.
57 Comments
Halicade  [author] Jul 21 @ 1:30pm 
@numa.ec If the mod was active while they were spawned, yes
numa.ec Jul 21 @ 12:44pm 
Does it affect starting pawns?
Halicade  [author] Jul 15 @ 3:34pm 
@TheAsh Recommended is for genes that can break if placed on incorrect pawns only.
The summoning genes have been on the possible exclusions list since I made it though
TheAsh Jul 15 @ 1:02pm 
You should add the summoning genes from "Alpha Genes" mod to the recommended exclusions list.

Or better yet, implement some setting to just make it rarer, otherwise pretty much every roll you get 1 or 2 summons.
Amnaa Jun 29 @ 8:55am 
@Halicade Huh, I just tried to prepare a log for you using debug commands and nothing suspicious happened with the genes. Maybe something got accidentally fixed recently? Anyway, if I ever notice something, I will reload and log it for you. Thank you for the mod anyway! I've always felt like pristine xenotypes are a little unnatural.
Halicade  [author] Jun 29 @ 8:37am 
@Amnaa I just tried it out with a couple babies. They had no extra genes at birth which was good. But they didn't gain genes after becoming children either. I'm going to need a log with my mods logging enabled to better see what happened.
Halicade  [author] Jun 29 @ 8:13am 
When they become children? What the heck? I'll check it out
Amnaa Jun 29 @ 7:49am 
When babies are born, they have no additional genes. However when they grow up into children, they do gain the genes. I do have the baby option turned off. Am I missing something else?
Halicade  [author] Jun 24 @ 1:45pm 
Should be fixed! Just had to update some references to big and small I had. Thanks for noticing!
csc001 Jun 23 @ 10:34pm 
when use your mod with big&small mod collection,some thing wrong

[13:32:22] Error while generating pawn. Rethrowing. Exception: System.TypeLoadException: Could not resolve type with
[13:32:22] Error in WorldGenStep: System.TypeLoadException: Could not resolve type with token O10oo01a from typeref
[13:32:23] Error while generating pawn. Rethrowing. Exception: System.TypeLoadException: Could not resolve type with
[13:32:23] There was an exception thrown by the PawnGenerator during generating a starting pawn. Trying one more
[13:32:23] Eror while generating pawn. Rethrowing. Exception: System.TypeLoadException: Could not resolve type with
[13:32:23] Exception from asynchronous event: System.TypeLoadException: Could not resolve type with token 010oo01a