Jump to content

Milkable Colonists updated for 1.1


Recommended Posts

@Hawk32

Right now the multiplier makes it so instead of getting 1 milk each job tick, you get that multiple of milk each job tick. I could look into making that a job tick speed multiplier instead, I think that should work without too many problems.

 

Offhand I have no idea how this setup would work with animals. There's a lot of assumptions in the MC code, and the RJW code in general that assumes a human is a human with all the human code paths.

If you did want to make an animal compatible version of this mod you'd be better off making a separate milkable comp to add to the animals, and animal specific jobs probably with less checks and restrictions.

Edited by onslort
Link to comment

Yea I already have a custom milkable comp for them normally was just hoping there was an easy fix for them since they act like colonists in most regards.

 

As far as the job speed goes I just found it strange that you could speed up the extraction but not change the overall length of certain jobs.

 

An alternative would be to have a stop put in for when they have no more milk left to extract in a similar way to how the feeding job stops when the pawn gets to a % fullness. 

Link to comment

@onslort

I figured out the reason I got it to work was I added standard breasts and then removed them to try and trigger it. It didn't actually work before your latest update.

Also it appears that setting the milk multipliers for diffrent breast type doesn't work.
In test with arcotech breasts the milking just has the total milk bottles value oscillate up and down every time milk bottles are produced. It seems to be going back to 100% for the actual milk extraction then jumping the number back to the 125% for display each tick.


 

Link to comment

@onslort I got it to trigger a weirder version of the original problem for bionic breasts.
Instead of makeing no milk they went to full got milked and broke.

I had to add another breast type to trigger the actual milk production. Once it started I could remove them and it kept going.
However upon filling and being milked for the first time it broke.

image.png.b7836ba5f4a2f62dbdc7934f3c32a109.png

image.png.441690ee9c52fb9164541d27ea86d4a0.png

Link to comment

I just performed some tests. New game, minimal mods. Created multiple colonists using character editor before the game started.

One with natural breasts. One with Hydralic, one with Bionic, One with Archotech.  All sized at 0.5 severity to make amount comparisons easier.

 

Started game, spawned in bottles of laxt-x for each. Had each pawn drink to start lactating. All pawns started properly. With the sliders the pawns with hydraulic and bionic have less milk at 100% fullness than the pawn with natural breasts, and the pawn with archotech breasts has more bottles at 100% fullness.

 

Once full I had each try manual milking, filled again and then tried breastfeeding, then lastly self milking, and everything kept working correctly. Numbers counting up slowly as they should.

 

It all appears to be working fine as far as I can tell. If the numbers are jumping around, do you have any other mods that might be trying to interface with MC in some way? The only other one I'm aware of right now is C0ffee's RIA, but that hasn't been updated for weeks from what I can see and should be fine. I had it active during my test above and all was normal.

 

I do know from the first time I did the tests and got it accidentally working it was from adding natural breasts with a pawn with hydraulic breasts. That shouldn't be necessary anymore. I suppose it's possible with an older save it might still be bugged out in some way. But if the latest patch doesn't fix it I'm not sure what will. In my tests it all seems to work correctly.

 

 

Link to comment
  • 3 weeks later...
  • 2 weeks later...

I've tried several times and I still don't quite understand the mechanics of the workspeed/amount multiplier.

 

From my test x1 speed and x10 speed the amount of milk that is bottled is hardly changed, but the speed of working is truly accelerated. For example, milking self is almost one second under x10 speed and the progress bar almost disappeared due to that speed comparing with x1 speed. However the amount is always 3x bottle regardless of x10 multiplier or x1 of that.

 

Is that working properly? And one exception is that breastfeeding children speed remained the same rate under x1 and x10 multiplier.

Link to comment

Right now it should be a straight multiplier. At 1 you'll get 1 bottle each time the work tick occurs, at 3 you'll get 3 bottles each tick (if the pawn has 3 bottles to give.)

 

It doesn't change the work speed currently. When I'm feeling enthusiastic I'll update it.

Link to comment

New version. Nothing major, quality of life tweaks.

The work speed/amount multiplier now changes work speed for most tasks.  Only Biotech baby breastfeeding is untouched, it will still be a work result multiplier instead of a speed multiplier.

 

Added option sliders:

Hunger amount offset for Lact-Max hediff.  Default is 40%, but now you can slide this down if you want.
Hunger amount offset for Hyper-Lact-Max hediff.  Default is 80%, but now you can slide this down if you want.
Lactation fertility factor override.  By default the Biotech Lactating hediff makes your pawn's fertility 5%.  You can now adjust that and make it higher if you want your milk providing pawns to still have children.  Or set it to 0 if you really hate children. Do what makes you happy.

 

The second, possibly more game changing update.  I updated the 'who can give milk' patch file so that it should affect all pawns, including HAR races.

This is located in rjw-mc-biotech\1.4\Patches\RaceMilkPatch.xml

 

If you're already running your own adjusted 'who give what milks' patch file you can keep your own. 

If you want to go back to only base rimworld humanoids giving milk, you can delete the top section from that file and un-comment out the bottom section (Remove the <!-- and -->)

For most it should just work as is though.

I am not sure if you need a new save for this to work with existing pawns. My testing has varied.  With a new game I can have any pawn from any race mod drink a lact-x and start making milk.

 

Convenient link to download post

Link to comment
On 4/15/2023 at 11:06 AM, onslort said:

Right now it should be a straight multiplier. At 1 you'll get 1 bottle each time the work tick occurs, at 3 you'll get 3 bottles each tick (if the pawn has 3 bottles to give.)

 

It doesn't change the work speed currently. When I'm feeling enthusiastic I'll update it.

Thank's for answering. So that is to say, the total amount of bottles a pawn could give is fixed but the speed to reach that amount is accelerated? That's clear for me now.

Link to comment
  • 1 month later...

@onslort

Work finally gave me time to play regularly again. 

I went to modify the source code since pawns with large total breast severity were useless given milking speed was not relative to total milk and so they produced far more than a pawn could ever milk.
I made is so loop count runs based on a percentage of total bottles in the breasts.

Anyways besides the point.
In doing so I decided to look into my previous error where I saw the milk bottle count fluctuate up and down when being milked whenever I had the artificial breast milk amount modifiers at something other than 100%.

I found the problem.
totalBreastSev is calculated separately in TryMakeBottle,TryFeedPartner, and CompTick.

However only CompTick has the compensation that multiplies thisSev by MilkSettings.BreatMilkModifier*breasttype*
Line 416 ish my lines numbers are a little diffrent.

I updated the foreach loop of TryMakeBottle and TryFeedParter and now the bottle count stays consistent for artificial breast while being milked or breastfed.

this.bottleCount keeps getting set to the incorrect number when the bad totalBreastSev is calculated in TryMakeBottle and TryFeedPartner. Then is corrected next time CompTick runs causing the value to jump back and forth.

Idk how this affected actual milking results but I noticed milking would often stop early when there was plenty of bottles left because of it.

Edited by OriginalNocare
Link to comment

@OriginalNocare

 

Thanks for the info. I moved the breast size calculations into a shared function to make that easier to manage and so I couldn't mess up that bit of math again should something else change in future.

 

The latest version already has a speed multiplier instead of a work result amount multiplier, at 10x speed it's really quick to milk. (Or it should be.)

 

Version 011d added with fixed math for artificial breast milking amounts.

Convenient link to download post

Link to comment

@onslort
Sorry for the confusion I was being overly descriptive with my sharing.

The speed multiplier works great. I just personally for my colony wanted slow milking for small breasts/low numbers of breasts; with like 20 milk. However, still be able to use pawns with enough size/number to have 500-1000 milk.

At some point I will probably make personal changes to also make it more challenging for calories in vs calories out. As it is now its very easy to get so net positive that a single pawn can feed 20 other pawns and themself while also running chemfuel power.
I know a stricter limit on breast size and breast amount would do that without changes but thats not as fun
 

Link to comment
  • 1 month later...

Is anyone else using this in combination with Androids Expanded (https://steamcommunity.com/sharedfiles/filedetails/?id=2890036704)?

 

It looks like this mod is making androids unable to interact with pawns in some ways, specifically doctoring.  When I select an android, and right-click on an injured pawn, I get the following error in the log:

 

Root level exception in OnGUI(): System.NullReferenceException: Object reference not set to an instance of an object
  at Milk.WorkGiver_BreastfeedAdult.HasJobOnThing (Verse.Pawn pawn, Verse.Thing t, System.Boolean forced) [0x00037] in <018f9717612d4c91898e3a2f35ff18fa>:0
  at RimWorld.FloatMenuMakerMap.AddJobGiverWorkOrders (UnityEngine.Vector3 clickPos, Verse.Pawn pawn, System.Collections.Generic.List`1[T] opts, System.Boolean drafted) [0x001a9] in <95de19971c5d40878d8742747904cdcd>:0
  at RimWorld.FloatMenuMakerMap.AddUndraftedOrders (UnityEngine.Vector3 clickPos, Verse.Pawn pawn, System.Collections.Generic.List`1[T] opts) [0x00085] in <95de19971c5d40878d8742747904cdcd>:0
  at (wrapper dynamic-method) RimWorld.FloatMenuMakerMap.RimWorld.FloatMenuMakerMap.ChoicesAtFor_Patch2(UnityEngine.Vector3,Verse.Pawn,bool)
  at RimWorld.FloatMenuMakerMap.TryMakeFloatMenu (Verse.Pawn pawn) [0x000dc] in <95de19971c5d40878d8742747904cdcd>:0
  at RimWorld.Selector.HandleMapClicks () [0x000ac] in <95de19971c5d40878d8742747904cdcd>:0
  at RimWorld.Selector.SelectorOnGUI () [0x00000] in <95de19971c5d40878d8742747904cdcd>:0
  at RimWorld.MapInterface.HandleLowPriorityInput () [0x0000f] in <95de19971c5d40878d8742747904cdcd>:0
  at (wrapper dynamic-method) RimWorld.UIRoot_Play.RimWorld.UIRoot_Play.UIRootOnGUI_Patch1(RimWorld.UIRoot_Play)
  at (wrapper dynamic-method) Verse.Root.Verse.Root.OnGUI_Patch2(Verse.Root)
UnityEngine.StackTraceUtility:ExtractStackTrace ()
Verse.Log:Error (string)
(wrapper dynamic-method) Verse.Root:Verse.Root.OnGUI_Patch2 (Verse.Root)

 

Link to comment
4 minutes ago, dastardlii said:

Is anyone else using this in combination with Androids Expanded (https://steamcommunity.com/sharedfiles/filedetails/?id=2890036704)?

 

It looks like this mod is making androids unable to interact with pawns in some ways, specifically doctoring.  When I select an android, and right-click on an injured pawn, I get the following error in the log:

 

Root level exception in OnGUI(): System.NullReferenceException: Object reference not set to an instance of an object
  at Milk.WorkGiver_BreastfeedAdult.HasJobOnThing (Verse.Pawn pawn, Verse.Thing t, System.Boolean forced) [0x00037] in <018f9717612d4c91898e3a2f35ff18fa>:0
  at RimWorld.FloatMenuMakerMap.AddJobGiverWorkOrders (UnityEngine.Vector3 clickPos, Verse.Pawn pawn, System.Collections.Generic.List`1[T] opts, System.Boolean drafted) [0x001a9] in <95de19971c5d40878d8742747904cdcd>:0
  at RimWorld.FloatMenuMakerMap.AddUndraftedOrders (UnityEngine.Vector3 clickPos, Verse.Pawn pawn, System.Collections.Generic.List`1[T] opts) [0x00085] in <95de19971c5d40878d8742747904cdcd>:0
  at (wrapper dynamic-method) RimWorld.FloatMenuMakerMap.RimWorld.FloatMenuMakerMap.ChoicesAtFor_Patch2(UnityEngine.Vector3,Verse.Pawn,bool)
  at RimWorld.FloatMenuMakerMap.TryMakeFloatMenu (Verse.Pawn pawn) [0x000dc] in <95de19971c5d40878d8742747904cdcd>:0
  at RimWorld.Selector.HandleMapClicks () [0x000ac] in <95de19971c5d40878d8742747904cdcd>:0
  at RimWorld.Selector.SelectorOnGUI () [0x00000] in <95de19971c5d40878d8742747904cdcd>:0
  at RimWorld.MapInterface.HandleLowPriorityInput () [0x0000f] in <95de19971c5d40878d8742747904cdcd>:0
  at (wrapper dynamic-method) RimWorld.UIRoot_Play.RimWorld.UIRoot_Play.UIRootOnGUI_Patch1(RimWorld.UIRoot_Play)
  at (wrapper dynamic-method) Verse.Root.Verse.Root.OnGUI_Patch2(Verse.Root)
UnityEngine.StackTraceUtility:ExtractStackTrace ()
Verse.Log:Error (string)
(wrapper dynamic-method) Verse.Root:Verse.Root.OnGUI_Patch2 (Verse.Root)

 

 

Note that the droids in question DO have breasts (which is funny, but okay), but since the error is related to breastfeeding, maybe the error is because they do not have mouths?

Link to comment

Okay, I decided to stop being lazy and fixed it myself.  The problem is caused by androids not having a food need.  The fix is to add the following to the Workgiver_BreastfeedAdult.cs file at line #30:

 

if(pawn.needs.food == null)
{
     // pawn has no food need.  Stopping
     return false;
 }

 

For anyone else who has this issue, I've attached an updated dll with the fix.  Just unzip it and replace the one in ...\Mods\rjw-milkable-colonists-biotech\1.4\Assemblies\

 

Milk.zip

Link to comment
  • 1 month later...
  • 3 weeks later...

any way to get this to work with Vanilla Milk Expanded and its [DHM]Vanila Milk Expanded for Human patch on steam workshop? The human patch uses the steam fork of the original mod but doesn't seem to be compatible with this version of MC (which has a lot more features!)

 

I know I should ask on that mod's page i'm not about to post questions about lewd mods on my main steam account, lmao

 

edit: here's the error I get

 

https://imgur.com/a/3wsHfzx

Edited by camistrie
Link to comment

Late reply. I blame Baldurs Gate 3.

I ended up changing a lot of things in this version of Milkable Colonists that makes it quite a bit less compatible with older mods. But as I'm between games until Starfield launches I figured I'd have a look.

 

The Vanilla Milk Expanded For Humans mod looks to be trying to call the original function "Gathered" that would spawn the bottles and set the fullness to 0% all in one go.

 

I changed that entire setup so that milking works 1 bottle at a time (multiplied by values in the new settings) and the old Gathered function was removed.

 

As a test, I re-added the Gathered function and set it to run the newer functions I made, to spawn multiple bottles and then force the fullness/bottles to 0 after to replicate what it used to do.

 

However whatever Vanilla Milk Expanded does to tell a pawn to stop the milking job doesn't seem to ever happen, and so the pawn gets stuck on the 'milking machine' chair forever and I'm not sure why or how to stop it.

 

I think it may actually change the MilkHuman job as that stops working completely and pawns will not do the standard milking on one another when the Vanilla Milk Expanded For Humans is enabled.  In the end I'm not sure what is happening behind the scenes on those other mods but it doesn't look to be easily fixable. (Not by me, anyway.)

Link to comment

New version!  (This version is not on gitgud yet. Currently treating as experimental in case I broke something.)

 

After looking over code yesterday regarding Vanilla Milk Expanded, I got the urge to do some more of my own.

 

Added a milking station building. Can be found in Production, available after you research Smithing.  It uses the stool graphics for now. I am not arty. This will extract milk twice as fast as basic self milking.

 

New column added to the options for who can do what milking jobs to allow/disallow milking at the milking station. Also uses the stool graphic for now.

 

New option added to the mod options so you can set the milk amount before the pawn will start wanting to look for a milking station.

 

The milking station will store the milk in itself. You can change the priority of storage so that pawns will remove the bottles from the station and move them somewhere else.  It does NOT keep milk fresh. (Maybe put the station in a freezer?)

 

 

And an extra. The above also has optional mod integration.  If you have Vanilla Expanded Framework and Vanilla Milk Expanded, the milking station will connect to the milk pipes and tanks. 

*** Do not use the "Vanilla Milk Expanded for Humans" patch on steam. It is not compatible. I made this version of Milkable Colonists compatible without it.***

 

A caveat. With the above mods active, any humanoid milk bottles put into the MC version of the Milking Station get turned in 'milk'.  This may or may not be unbalanced. I just wanted to get it working. It seems to be. You can then extract the normal milk using the Vanilla Milk Expanded buildings.

 

(Also added the food need fix above from dastardlii for androids.)

 

Possible future ideas. Different Milking Stations. (Luxury Milking Stations that give mood buffs?)

 

Convenient link to download post

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