[B19] HarvestYieldPatch - now it does what you always thought it does

Started by Syrchalis, August 01, 2018, 03:02:41 PM

Previous topic - Next topic

Syrchalis

Introducing the Harvest Yield Patch.



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
Github

Thanks to Mehni and spd, potatoclip for help with C#, because I'm a total noob.
For mod support visit the steam pages of my mods, Github or if necessary, write me a PM on Discord. Usually you will find the best help in #troubleshooting in the RimWorld discord.

Valor

Hello, any chance for B18 variant? Or is it compatible with B18?

Syrchalis

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.
For mod support visit the steam pages of my mods, Github or if necessary, write me a PM on Discord. Usually you will find the best help in #troubleshooting in the RimWorld discord.

Zxypher

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()

Canute

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.

Zxypher

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]

Canute

Hey, glad to hear you master the neurochiruge err modding ! :-)

christianmc1101

Mein Lieblingswort: My favorite word:
Bundespräsidentenstichwahlwiederholungsverschiebung