Ludeon Forums

Ludeon Forums

  • February 28, 2020, 10:11:52 AM
  • Welcome, Guest
Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Wild animals produce milk  (Read 629 times)

Bodog999

  • Colonist
  • ***
  • Posts: 324
  • Calm Player
    • View Profile
Wild animals produce milk
« on: February 04, 2016, 03:59:39 PM »

So after going trough all the files of the core game I'm still unable to get wild animals to produce milk. So far I know that the animal has to be tamed in order to start producing milk. I would like to have wild animals to produce milk to test some stuff. Does anyone know if its possible?
Logged

Fluffy (l2032)

  • Planetologist
  • ****
  • Posts: 1397
  • Cat guy
    • View Profile
Re: Wild animals produce milk
« Reply #1 on: February 05, 2016, 02:07:59 AM »

You problem is that CompHasGatherableBodyResource, from which both milking and sheering derive, has a default implementation of only being active when a pawn has a faction (wild animals have null faction).
Code: [Select]
protected virtual bool Active
{
get
{
return this.parent.Faction != null;
}
}
Both milkable and shearable check this base implementation first before they proceed;
Code: [Select]
get
{
if (!base.Active)
{
return false;
}
Pawn pawn = this.parent as Pawn;
return (!this.props.milkFemaleOnly || pawn == null || pawn.gender == Gender.Female) && (pawn == null || pawn.ageTracker.CurLifeStage.milkable);
}

So, what can you do? Custom dll for new CompMilkable, inherit compmilkable and override the Active property to no longer consider the base implementation.
Logged