Ludeon Forums

RimWorld => Mods => Releases => Topic started by: Syrchalis on August 01, 2018, 03:02:41 PM

Title: [B19] HarvestYieldPatch - now it does what you always thought it does
Post by: Syrchalis on August 01, 2018, 03:02:41 PM
Introducing the Harvest Yield Patch.

(https://i.imgur.com/IdjCAhK.png)

You think you know what the stat "Plant Harvest Yield" does? Well, let me surprise you - it does NOT increase the amount you get when you harvest plants, like "Mining Yield" does for ores.

It merely gives you a chance to fail below 100%, above 100% you do not gain anything.

This changes now! This small C# patch changes the method when harvesting plants so that below 100% nothing changes (you still have a chance to fail, but get 100% of the amount IF you succeed) - but above 100% you get more from the plant. If you have 177% plant harvest yield and the plant usually gives 10 berries, then you now get 17 or 18 (random).

Important: This mod removes the max values from all "yield" stats. This includes: MiningYield, AnimalGatherYield, PlantHarvestYield, ButcheryFleshEfficiency and ButcheryMechanoidEfficiency. Meaning those stats can now be more than 100%. If you don't wish this for any of these stats, go into HarvestYieldPatch/Patches/HarvestYieldXMLPatch.xml and remove the defNames of the stats you don't want edited.

Steam (https://steamcommunity.com/sharedfiles/filedetails/?id=1461790308)
Github (https://github.com/Syrchalis/HarvestYieldPatch)

Thanks to Mehni and spd, potatoclip for help with C#, because I'm a total noob.
Title: Re: [1.0] HarvestYieldPatch - now it does what you always thought it does
Post by: Valor on August 01, 2018, 04:39:37 PM
Hello, any chance for B18 variant? Or is it compatible with B18?
Title: Re: [1.0] HarvestYieldPatch - now it does what you always thought it does
Post by: Syrchalis on August 01, 2018, 04:42:30 PM
You can try it out. It depends whether the code of the plant was changed from B18 to 1.0. It's very likely it doesn't work, but there is definitely a chance that it does.

However I won't make a B18 version, because 1.0 is rather far by now and I'm not willing to go through the trouble for a soon-to-be-outdated version. The transpiler code in there is pretty complex and I didn't write it myself, so it would be a huge effort.
Title: Re: [1.0] HarvestYieldPatch - now it does what you always thought it does
Post by: Zxypher on August 02, 2018, 05:23:29 PM
I added this to my B18 and it doesn't seem to have thrown any errors yet. Still have to test functionality though. Thanks for this mod I never tested to see if Harvest Yield actually worked before.

EDIT: Sadly it does not appear to actually change the harvest yield. Guess I'll have to wait till 1.0.

EDIT2: I checked more carefully and actually did find an error in the log for B18 if anyone cares to try to fix/patch it.

Could not execute post-long-event action. Exception: System.TypeInitializationException: An exception was thrown by the type initializer for HarvestYieldPatch.HarmonyPatches ---> System.MissingMethodException: Method not found: 'Verse.Log.Message'.
  --- End of inner exception stack trace ---
  at (wrapper managed-to-native) System.Runtime.CompilerServices.RuntimeHelpers:RunClassConstructor (intptr)
  at System.Runtime.CompilerServices.RuntimeHelpers.RunClassConstructor (RuntimeTypeHandle type) [0x00000] in <filename unknown>:0
  at Verse.StaticConstructorOnStartupUtility.CallAll () [0x00000] in <filename unknown>:0
  at Verse.PlayDataLoader.<DoPlayLoad>m__2 () [0x00000] in <filename unknown>:0
  at Verse.LongEventHandler.ExecuteToExecuteWhenFinished () [0x00000] in <filename unknown>:0
Verse.Log:Error(String)
Verse.LongEventHandler:ExecuteToExecuteWhenFinished()
Verse.LongEventHandler:UpdateCurrentAsynchronousEvent()
Verse.LongEventHandler:LongEventsUpdate(Boolean&)
Verse.Root:Update_Patch1(Object)
Verse.Root_Entry:Update()
Title: Re: [1.0] HarvestYieldPatch - now it does what you always thought it does
Post by: Canute on August 03, 2018, 03:06:46 AM
Zxypher,
sorry but you will need a neurochiruge to fix/patch the issue.
Basicly you can't use a 1.0 version mod on a B18 gameplay. Yes you have to wait/use for the 1.0 version.
And i don't think anyone will made a similar mod for older releases.
Title: Re: [1.0] HarvestYieldPatch - now it does what you always thought it does
Post by: Zxypher on August 04, 2018, 01:33:36 PM
So I loaded up the source and just re-built it with the B18 dll's and it's working fine for me so far. Use at your own risk I guess. If you want me to remove the links let me know.

[attachment deleted due to age]
Title: Re: [1.0] HarvestYieldPatch - now it does what you always thought it does
Post by: Canute on August 05, 2018, 03:39:24 AM
Hey, glad to hear you master the neurochiruge err modding ! :-)
Title: Re: [1.0] HarvestYieldPatch - now it does what you always thought it does
Post by: christianmc1101 on August 05, 2018, 05:27:19 AM
Canute: Thats nearly impossible!
Zxypher: Hold my beer.