vegapnk / RJW-Genes

Rimworld Biotech Genes related to RJW
MIT License
24 stars 28 forks source link

Animal Genes for Menstruation Eggs #67

Open vegapnk opened 8 months ago

vegapnk commented 8 months ago

I got a report that menstruation eggs do not fully work with the Animal Gene Inheritance.

Original chat:

H> Something odd going on in regards the biotech multi preg setting. 
Also @Vegapnk Something strange happening with animal gene inheritance. 
Its throwing an error dunno if I messed something up with the genedef for them and Im not sure if its because its a kyulen 
or because its paired with menstruation. 
When the child was born it had the kyulen race genes but didn't inherit the human 
fathers genes this doesn't appear to happen with other animals. 
Specifically i've had anima fox and house maid neko produce mixed gene types just fine.
[...]
So the first baby has completely broken genes
The other 3 [kyulen] babies that get added after all inherited the fathers genes and not the animals
V> for menstruation pregnancy (which is what you get when the mother is an animal), 
menstruation simply calls PregnancyUtility.GetInheritedGenes(father, mother), 
a vanilla function, to determine the baby's genes 
H> Yea so now I think the problem is on vega's end on to figure out how to apply the inheritance to every egg.
Also need to figure out why genital type isn't being applied by genes on birth
It worked when inherited from kyulen but not when inherited from human 

image image image image

Racedef:

<Defs>
<RJW_BGS.RaceGeneDef>
<defName>NinetailedFox</defName>
<!--
defName can be anything you want, as long as it is unique 
-->
<raceGroup>Ninetail_Group</raceGroup>
<!--
RJW.Racegroupdef, all animals in the raceGroup will be part of this group, RJW race support uses this so those can be used to quickly add a group 
-->
<raceNames>
<li>Ninetailfox</li>
<li>Ninetailfoxwt</li>
</raceNames>
<!--
For more direct control you can use raceNames directly. Use the defName of the animal. Can also use modded animals.
-->
<!--

        <pawnKindNames>
            <li> </li>
        </pawnKindNames>
        For even more direct control you can use pawnKindNames. 

        The RaceGeneDef for an animal will first be decided by if it is in the pawnkindNames, after that racenames and lastly racegroup,
        so if there is for a wolf a RaceGeneDef with the canine group and a second which has wolf under raceNames it will always use the second one to determine
        which genes can be inherited

-->
<genes>
<li>
<defName>Kyulen_Trait</defName>
<chance>1</chance>
</li>
<li>
<defName>AFU_BA_NineTailedFox</defName>
<chance>1</chance>
</li>
<li>
<defName>AFU_HA_FoxEar</defName>
<chance>1</chance>
</li>
<li>
<defName>StrongStomach</defName>
<chance>1</chance>
</li>
<li>
<defName>MoveSpeed_Quick</defName>
<chance>1</chance>
</li>
<li>
<defName>rjw_genes_big_breasts</defName>
<chance>1</chance>
</li>
<li>
<defName>rjw_genes_evergrowth</defName>
<chance>1</chance>
</li>
<li>
<defName>rjw_genes_canine_genitalia</defName>
<chance>1</chance>
</li>
<li>
<defName>rjw_genes_female_only</defName>
<chance>1</chance>
</li>
<li>
<defName>rjw_genes_extra_breasts</defName>
<chance>1</chance>
</li>
<!--
<li>
                <defName>rjw_genes_lifeforce_empath</defName>
                <chance>1</chance>
            </li>
            <li>
                <defName>rjw_genes_pussyhealing</defName>
                <chance>1</chance>
            </li> 
-->
</genes>
<!--
The genes which may be inherited. Use the defName of the gene, you can also add modded genes. 
-->
<!--
WIP, the chance of each gene to be inherited. Is in same order as genes, so for the second gene the chance to inherit is based on the second line in geweights. 
-->
</RJW_BGS.RaceGeneDef>
</Defs>
vegapnk commented 8 months ago

I got another error regarding this:

Error creating pregnancy in Nightmare's womb, father Campos: System.NullReferenceException: Object reference not set to an instance of an object
  at RJW_BGS.RaceGeneDef_Helper.ValidRaceGeneDefs (Verse.Pawn pawn) [0x0007f] in <60ac45948c154fe6924434a0fe654285>:0 
  at RJW_BGS.RaceGeneDef_Helper.GetRaceGeneDefInternal (Verse.Pawn pawn) [0x00000] in <60ac45948c154fe6924434a0fe654285>:0 
  at RJW_BGS.InheritanceUtility.SelectGenes (Verse.Pawn pawn) [0x00006] in <60ac45948c154fe6924434a0fe654285>:0 
  at RJW_BGS.InheritanceUtility.AnimalInheritedGenes (Verse.Pawn father, Verse.Pawn mother) [0x000b8] in <60ac45948c154fe6924434a0fe654285>:0 
  at RJW_BGS.Patch_RJW_BestialityPregnancyUtility.AddGenes (Verse.Pawn mother, Verse.Pawn dad, rjw.Hediff_BasePregnancy& __instance) [0x0008c] in <60ac45948c154fe6924434a0fe654285>:0 
  at (wrapper dynamic-method) rjw.Hediff_BasePregnancy.rjw.Hediff_BasePregnancy.Initialize_Patch1(rjw.Hediff_BasePregnancy,Verse.Pawn,Verse.Pawn,rjw.Hediff_BasePregnancy/DnaGivingParent)
  at rjw.Hediff_BasePregnancy.Create[T] (Verse.Pawn mother, Verse.Pawn father, rjw.Hediff_BasePregnancy+DnaGivingParent dnaGivingParent) [0x000ac] in <e70496b985674ea2bc0c6d308d5fad5e>:0 
  at rjw.Hediff_BasePregnancy.Create[T] (Verse.Pawn mother, Verse.Pawn father) [0x00009] in <e70496b985674ea2bc0c6d308d5fad5e>:0 
  at (wrapper dynamic-method) RJW_Menstruation.HediffComp_Menstruation.RJW_Menstruation.HediffComp_Menstruation.Implant_Patch0(RJW_Menstruation.HediffComp_Menstruation)
UnityEngine.StackTraceUtility:ExtractStackTrace ()
(wrapper dynamic-method) Verse.Log:Verse.Log.Error_Patch4 (string)
(wrapper dynamic-method) RJW_Menstruation.HediffComp_Menstruation:RJW_Menstruation.HediffComp_Menstruation.Implant_Patch0 (RJW_Menstruation.HediffComp_Menstruation)
RJW_Menstruation.HediffComp_Menstruation:LutealAction ()
RJW_Menstruation.HediffComp_PeriodicOvulator:LutealAction ()
(wrapper dynamic-method) RJW_Menstruation.HediffComp_Menstruation:RJW_Menstruation.HediffComp_Menstruation.CompPostTick_Patch0 (RJW_Menstruation.HediffComp_Menstruation,single&)
Verse.HediffWithComps:PostTick ()
(wrapper dynamic-method) Verse.Pawn_HealthTracker:Verse.Pawn_HealthTracker.HealthTick_Patch0 (Verse.Pawn_HealthTracker)
(wrapper dynamic-method) Verse.Pawn:Verse.Pawn.Tick_Patch2 (Verse.Pawn)
HardworkingNinetail.Ninetail:Tick ()
Verse.TickList:Tick ()
(wrapper dynamic-method) Verse.TickManager:Verse.TickManager.DoSingleTick_Patch3 (Verse.TickManager)
Verse.TickManager:TickManagerUpdate ()
(wrapper dynamic-method) Verse.Game:Verse.Game.UpdatePlay_Patch2 (Verse.Game)
Verse.Root_Play:Update ()
Hawkeye32 commented 2 months ago

Not sure if I ever mentioned it but the reason this wasn't working ending up having to do with race support not being configured properly for the animal. It didn't have a base animal to inherit from so it was failing. Once I added Kyulen to the canine group they worked properly.

Just thought I'd mention it in case I hadn't.