Jump to content

Milkable Colonists updated for 1.1


Vasho

Recommended Posts

Posted

Exception while recalculating Lactating_Essential thought state for pawn Оранжевая: System.TypeLoadException: Could not resolve type with token 01000069 (from typeref, class/assembly Milk.MilkBase, Milk, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null)
  at CRIALactation.ThoughtWorker_Precept_Lactating_Essential.ShouldHaveThought (Verse.Pawn p) [0x00037] in <333fe3400065487e98c2ee67f839a550>:0 
  at RimWorld.ThoughtWorker_Precept.CurrentStateInternal (Verse.Pawn p) [0x00054] in <3126aca1aad041dcbdeda807cfe004bf>:0 
  at RimWorld.ThoughtWorker.CurrentState (Verse.Pawn p) [0x00010] in <3126aca1aad041dcbdeda807cfe004bf>:0 
  at RimWorld.SituationalThoughtHandler.TryCreateThought (RimWorld.ThoughtDef def) [0x0001e] in <3126aca1aad041dcbdeda807cfe004bf>:0 
UnityEngine.StackTraceUtility:ExtractStackTrace ()
Verse.Log:Error (string)
RimWorld.SituationalThoughtHandler:TryCreateThought (RimWorld.ThoughtDef)
RimWorld.SituationalThoughtHandler:CheckRecalculateMoodThoughts ()
RimWorld.SituationalThoughtHandler:AppendMoodThoughts (System.Collections.Generic.List`1<RimWorld.Thought>)
RimWorld.ThoughtHandler:GetAllMoodThoughts (System.Collections.Generic.List`1<RimWorld.Thought>)
FacialAnimation.FacialAnimationControllerComp:UpdateAninmation (int)
FacialAnimation.FacialAnimationControllerComp:CompTick ()
Verse.ThingWithComps:Tick ()
(wrapper dynamic-method) Verse.Pawn:Verse.Pawn.Tick_Patch3 (Verse.Pawn)
Verse.TickList:Tick ()
(wrapper dynamic-method) Verse.TickManager:Verse.TickManager.DoSingleTick_Patch1 (Verse.TickManager)
Verse.TickManager:TickManagerUpdate ()
(wrapper dynamic-method) Verse.Game:Verse.Game.UpdatePlay_Patch2 (Verse.Game)
Verse.Root_Play:Update ()
 

Posted
On 12/17/2022 at 8:17 AM, Akaluto said:

And when will the developer panel be fixed? :D

If you have issues with the dev tool throwing an exception with something along the lines of "CompHyperMilkableHuman", check if you are running C0ffeeRIA (Ideology addon). Both mods are currently incompatible with each other and that was what was causing my issue with the dev tools screen.

Posted (edited)
8 hours ago, Akaluto said:

CRIALactation.ThoughtWorker_Precept_Lactating_Essential

 

As Thermite123 mentioned above, it looks like this error is from C0ffee's Rimworld Ideology Addons  (CRIA)

 

My newer version won't work correctly with it right now. There was a copy of the original 1.3 mod that I recompiled for 1.4 that will work better that you can find on page 6 of this thread, but that doesn't have any of my modification and is still slightly buggy. You can find it here. It's unsupported at the moment.

Edited by onslort
Posted

Ver 008 - DIY
Added new milking job: Milk Self. This is off by default and can be turned on per pawn in the same list with the rest of the milking jobs. Nothing extra is needed to do this right now. It might require a machine or something later on.
There is also a new option in the main mod options for the fullness required before a pawn will milk themselves. This is set to 150% fullness by default.

Added a debug option to show a pawn gizmo button to fill a pawns fullness to 150% with a click.

Updated the code so this version will no longer actually require Biotech. Breastfeed baby will be disabled if you don't have biotech installed. I haven't done a lot of testing but I think I have it mostly error free.

It is still incompatible with C0ffeeRIA at the moment.

Even though this no longer requires biotech it is still not compatible with 1.3.

 

Convenient link to download post

Posted
On 12/17/2022 at 11:29 PM, onslort said:

 

Probably not anytime soon. I actually have no idea what would be required in this case as animals work differently to regular colonists.

Oh, that's sad. But what's the difference between them exactly? I mean, they both have a hunger bar, both have a baby stage in life - shouldn't it look like: "the hunger bad drops to some level" ->"a baby animal pawn starts to seak mother for breastfeeding" -> "the mother gets stunned for few seconds when the baby reaches her" -> "the milk fullness of mother drops, the hunger bar of the baby fills", I don't know. 

Posted
On 12/19/2022 at 8:36 PM, kimbilmo said:

snip

I'm no modder, but from what I can tell the way that pawns and animals handle needs is quite different

Posted

I'm definitely appreciative of the updated mod, making it usable and improving it.

 

This isn't a question for this mod, but in general for a pet peeve I've had for a long time: Is there no mod to make food on the ground not for prisoners? Exactly like in the case for this mod - milking a prisoner is great. But now that milk sits on the ground and is only for prisoners, so I can't haul it elsewhere without manually picking it up and dropping it outside the prison.

 

Anyone know of a mod or something to deal with this?

Posted (edited)

"It is still incompatible with C0ffeeRIA at the moment." Will there a compability solution or is this going to be excluded from each other?

Edit:I tried using both and it seem to work fine. What is the reason for the incompability?

Edited by IPPPI
Posted (edited)

Ver 009 - Milkable Colonists C0ffeeRIA Compatibility

 

After chatting with C0ffeeeeee, I've updated and tweaked a lot of things to make this work with an updated version of C0ffee's RIA (which I will include here, and cross post.)


The new debug fill milk button will now toggle between 150%, 0% and 100% for testing.
Pawns belonging to a lactation/hucow ideology will also reset their natural lactation countdown when breastfed upon, similar to what happens when breastfeeding a child.
Pawns belonging to a lactation/hucow ideology will get increased happy thoughts when breastfeeding/breastfed upon.

This should also still work fine on it's own without CRIA, but there's no new gameplay in this release on its own.


C0ffee's Rimworld Ideology Addons updates:

Designating a pawn for induced lactation has changed slightly. Instead of using an internal timer now pawns will get a cooldown debuff hediff to show they have been recently induced.
Default cooldown timer is 30% of a day in length, and default amount of times induce is required is 20. This works out approximately 3 times a day for a week before lactation starts if you have no drugs to help.

Hucow values are now set to +250% yield and +150% production speed, with work speed and move speed set to 70%. The yield and speed values will combine with Milkable Colonist Lact-X hediffs that provide boosts.  You can end up with 2 x 2.5 for yield and 2 x 1.5 for speed using Hucow and Hyper Lact Max.
Hucows will fill several of their needs by performing milking tasks. Breastfeeding will grant the most needs bar, milked by another colonist second, lowest is self milking.
 

Added options for CRIA lacation:
Option to change the cooldown amount of inducing lactation. This will not change the timers on any existing cooldown hediffs.
Option to change the amount of times induce is required before lacation starts. This will not reset the progress on the current induce lactation. For example, if you are already halfway through the process and you increase the total to 50, it would take 25 induces from that point. Same is true if you make the total smaller.
There is an option to give a pawn a breast size increase when they get turned into a hucow. This is set to 0 by default and can be adjusted.
There is also a setting to set the minimum size that breasts become when turning into a hucow. This is set to 0.5 by default, which is average sized.

 

***Only this newest version of MC-Biotech is compatible with this newest version of CRIA. Make sure to get them both if you want to use CRIA.***

 

Convenient link to download post

Edited by onslort
Added Hucow needs note I forgot to add earlier.
Posted (edited)

Added a quick bugfix for CRIA.

 

The "Induced lactation recently" hediff was increasing, and never going away. Fixed the XML to count down instead of up.

I did testing to make sure the right amount of time was being added when the hediff was applied but only now in my real play-through did I realise it was counting the wrong way.

Edited by onslort
Posted (edited)

I caught the error "Milk.ThinkNode_Milk Self Checks.Satisfied" while playing. It appears on pawns that do not have the patch to support this mod. On humans and my race, where there is "CompMilkableHuman" this error does not. The race "Ratkin" or "Kurin_Race", for example, this error occurs.

 

Spoiler
Exception in Verse.AI.ThinkNode_Priority TryIssueJobPackage: System.NullReferenceException: Object reference not set to an instance of an object
  at Milk.ThinkNode_MilkSelfChecks.Satisfied (Verse.Pawn p) [0x00025] in <797c33c1b8804dd490fb7cfdbdfa5b9c>:0 
  at Verse.AI.ThinkNode_Conditional.TryIssueJobPackage (Verse.Pawn pawn, Verse.AI.JobIssueParams jobParams) [0x00000] in <3126aca1aad041dcbdeda807cfe004bf>:0 
  at Verse.AI.ThinkNode_Priority.TryIssueJobPackage (Verse.Pawn pawn, Verse.AI.JobIssueParams jobParams) [0x00022] in <3126aca1aad041dcbdeda807cfe004bf>:0 
UnityEngine.StackTraceUtility:ExtractStackTrace ()
(wrapper dynamic-method) Verse.Log:Verse.Log.Error_Patch3 (string)
Verse.AI.ThinkNode_Priority:TryIssueJobPackage (Verse.Pawn,Verse.AI.JobIssueParams)
Verse.AI.ThinkNode_SubtreesByTag:TryIssueJobPackage (Verse.Pawn,Verse.AI.JobIssueParams)
Verse.AI.ThinkNode_Priority:TryIssueJobPackage (Verse.Pawn,Verse.AI.JobIssueParams)
Verse.AI.Pawn_JobTracker:DetermineNextJob (Verse.ThinkTreeDef&)
Verse.AI.Pawn_JobTracker:TryFindAndStartJob ()
(wrapper dynamic-method) Verse.AI.Pawn_JobTracker:Verse.AI.Pawn_JobTracker.EndCurrentJob_Patch3 (Verse.AI.Pawn_JobTracker,Verse.AI.JobCondition,bool,bool)
(wrapper dynamic-method) RimWorld.Pawn_DraftController:RimWorld.Pawn_DraftController.set_Drafted_Patch1 (RimWorld.Pawn_DraftController,bool)
RimWorld.Pawn_DraftController:<GetGizmos>b__15_1 ()
Verse.Command_Toggle:ProcessInput (UnityEngine.Event)
Verse.GizmoGridDrawer:DrawGizmoGrid (System.Collections.Generic.IEnumerable`1<Verse.Gizmo>,single,Verse.Gizmo&,System.Func`2<Verse.Gizmo, bool>,System.Func`2<Verse.Gizmo, bool>,System.Func`2<Verse.Gizmo, bool>)
(wrapper dynamic-method) RimWorld.InspectGizmoGrid:RimWorld.InspectGizmoGrid.DrawInspectGizmoGridFor_Patch0 (System.Collections.Generic.IEnumerable`1<object>,Verse.Gizmo&)
RimWorld.MainTabWindow_Inspect:DrawInspectGizmos ()
RimWorld.InspectPaneUtility:ExtraOnGUI (RimWorld.IInspectPane)
RimWorld.MainTabWindow_Inspect:ExtraOnGUI ()
Verse.WindowStack:WindowStackOnGUI ()
(wrapper dynamic-method) RimWorld.UIRoot_Play:RimWorld.UIRoot_Play.UIRootOnGUI_Patch3 (RimWorld.UIRoot_Play)
(wrapper dynamic-method) Verse.Root:Verse.Root.OnGUI_Patch2 (Verse.Root)


I will attach a log file, if you need it to solve the problem with Comp.

 

I guess the problem is that the variable "myComp" is not checked for null on lines 31-32 of the "ThinkNode_MilkSelfChecks.cs" file. That's why this error appears.

 

P.S.  As I suspected, it was because of null in the variable. I added a check for null and after that the error stopped appearing.

 

This is a line of code in ThinkNode_MilkSelfChecks.cs

if (myComp?.BottleCount < 1 || myComp == null) return false;

 

And these are the lines of code in JobGiver_MilkSelf.cs

if (myComp?.Fullness >= MilkSettings.fullnessMilkSelfAmount)
{
  if (myComp?.BottleCount > 0)
  {
    //Log.Message(pawn.Name.ToString() + " Trying job milkself");
    var myJob = DefDatabase<JobDef>.GetNamed("MilkSelf");
    //Job getting_milked = JobMaker.MakeJob(myJob, pawn);
    Job tempJob = JobMaker.MakeJob(myJob, pawn, null, null);
    //if (tempJob == null) { Log.Message("Null job"); }
    return tempJob;
  }
}

 

I compiled the .dll file with these changes and will post it here for those who need it. File should be placed in the folder "rjw-mc-biotech_009\1.4\Assemblies" with replacement of the file. Milk.dll

Edited by Akiya82
Added a solution to the problem
Posted
6 hours ago, Nyomnom said:

Will this new version of CRIA be updated in the git version too?

 

C0ffee knows about it but is also busy with other things.

 

Right now I'll probably be doing more smaller updates such as taking a look at the bug above.

 

Once the code is more bug free I'll hit him up again with the latest version to update on gitgud.

 

 

 

Posted
3 hours ago, Akiya82 said:

I caught the error "Milk.ThinkNode_Milk Self Checks.Satisfied" while playing.

 

Thanks!

I added null checks based on your suggestion and recompiled, and noticed you had done the same.  :)

 

New version of the mod is uploaded to my main post.

 

I guess I need to add a HAR race to my testing.

Posted (edited)

Hm, the option to self milk is supposed to be in the work tab? I can't seem to find it. There is an option to breastfeed adults, but no self milking job. I made a direct upgrade, just removed the old version and added the new one and loaded my save file. May bee that is the reason?

Ah, I found out the reason. I was looking for the job in the actual job tab. It somehow escaped my mind that there is a separate tab for the milking.

Edited by zloiiojik
Posted

A note for people using HAR pawns that might not know this. Included in the MC mod, in the folder:

rjw-mc-biotech\1.4\Patches

Is a file named MilkPatch.xml.bak

If you delete the .bak from that filename, this should patch a good portion of your HAR pawns to allow them to produce milk.

 

This file existed before I started making changes to the mod and it still works. (Such as Ratkin which I tested just now.)

 

Including the information here as there's a chance people don't realise the option is available.

Posted

Dear author, I really appreciate this interesting mod and the effort you put on the modification. Recently when playing, I found that the milking procedure won't be valid as long as the pregnant pawn is down, either lying on bed or losing both legs. I just wonder if it's intentionally designed this way? 

Posted (edited)
12 hours ago, FanonFaulkes said:

Dear author, I really appreciate this interesting mod and the effort you put on the modification. Recently when playing, I found that the milking procedure won't be valid as long as the pregnant pawn is down, either lying on bed or losing both legs. I just wonder if it's intentionally designed this way? 

 

Not intended. I tweaked the logic to make jobs valid and I added 'downed pawns' as invalid targets but that might be too restrictive for some tasks. I'll do some testing and get a fix in some time soon.

Edited by onslort
Posted
50 minutes ago, onslort said:

 

Not intended. I tweaked the logic to make jobs valid and I added 'downed pawns' as invalid targets but that might be too restrictive for some tasks. I'll do some testing and get a fix in some time soon.

 

One issue I've found with downed pawns is if another pawn wants to breastfeed from the downed pawn they will be stuck "Standing" until the downed pawn recovers, even if there are other pawns available to feed off of.

Posted

After taking a look at the interactions with downed pawns, it seems my early hacking has come back to bite me in the butt, and not in a good way.

 

I was using the tick in the comp update to check what job a pawn might be doing and then do work in that location in code. Which doesn't work if the pawn is downed and can't do a job. (My hack. I knew it was a hack going in.)

 

So I'll be moving some stuff around to make this more sensible.

Posted

Ver 010 - The re-jobening.

 

Reworked how the milking jobs work on the back end so that the jobdrivers do the work instead of just being something that are watched for. This has also allowed me to make downed/sleeping pawns valid targets for milking jobs. And maybe even fixed a bug or two concerning starting too many jobs in a single tick.

 

Also added another page to the milking designations page so you can set what your slave/prisoners will do/have done to them, just like your colonists.

 

This new version is CRIA compatible but I haven't had too much time to test it in a real game, so I'm leaving the ver009 download available as well.

 

Convenient link to download post

Posted

Looks good.  Just had a deathresting pawn milked without interrupting the deathrest, so that's working better than her last deathrest.  Had a red error pop up on startup about not finding the hucow meme (I don't have CRIA installed), but that's probably safe to ignore.

Posted

Seems to be working well now for downed pawns.

 

Another issue I've found is that the "Combine Human Milk" recipe doesn't seem to activate. No pawn will go do the recipe even if I have the necessary humanoid milk bottles. Looks like it's looking for something called "0.5x nutrition (human milk bottle)" rather than normal bottles. Don't know if that is related.

 

Is there any plans to make this work with Licentia Labs' cum feeding mechanic? It would be cool to designate those pawns for feeding in the same fashion. Though I imagine that's a lot more complicated than just modifying the base game milking mechanics.

Posted (edited)

@Shamous There are human milk bottles and humanoid milk bottles. The mod at the moment will only create humanoid milk bottles but I left the human version in for backwards compatibility for anything that might be using it.

 

If you are setting up the combine job, make sure to use the combine humanoid milk recipe.

 

No plans at the moment for cum feeding but it is something that I've pondered from time to time. However as long as there are other active mods already doing something like that I don't want to stomp on anyone's toes.

Edited by onslort
Posted
11 minutes ago, onslort said:

@Shamous There are human milk bottles and humanoid milk bottles. The mod at the moment will only create humanoid milk bottles but I left the human version in for backwards compatibility for anything that might be using it.

 

If you are setting up the combine job, make sure to use the combine humanoid milk recipe.

 

No plans at the moment for cum feeding but it is something that I've pondered from time to time. However as long as there are other active mods already doing something like that I don't want to stomp on anyone's toes.

 

Ah that makes sense. That's my mistake then.

 

And yes, there are a number of other modders doing similar stuff but so far your mod is the only one that actually seems to have a direct pawn to pawn work giver with the breast feeding job. So far the others (Licentia Labs and the Cum Dependency Gene that I know of) don't give the same kinds of pawn behavior (ie, find a suitable other pawn to feed off of). This is what makes this mod much more compelling.

 

It seems like all the pieces are already in place, but it would be a combination of multiple mods at this point I think to get the cum feeding to work properly. You'd have to use something like this mod to designate a pawn as available for feeding, then make it so hungry pawns would seek them out (if Licentia is active) or dependent pawns with a deficiency (with the Cum Dependency Gene). Then, you'd want it to trigger the "fellatio" job from RJW base.

 

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...