[1.0] Smart Medicine

Started by Uuugggg, February 22, 2018, 02:29:07 PM

Previous topic - Next topic

Marsunpaisti

Hmm. Not using either one of those. Perhaps its just the reloading of the save that fixes the errors then.

Reaper

Where can I find the config file for the mod settings?

Canute

Like all other config files too, should be same area like the safegames.
When you use windows open Options then click at "Open safe data folder".

alexo


Kori

Smart Medicine seems to be conflicting with the Prison Labor mod.
When a prisoner is working as a doctor and tries to use medicine it's not possible and the following error appears

JobDriver threw exception in initAction. Pawn=Wolverine, Job=TendPatient (Job_1209010) A=Thing_Human15994, Exception: System.NullReferenceException: Object reference not set to an instance of an object
  at Verse.AI.Toils_Haul+<CheckForGetOpportunityDuplicate>c__AnonStorey2.<>m__0 () [0x00000] in <filename unknown>:0
  at Verse.AI.JobDriver.TryActuallyStartNextToil () [0x00000] in <filename unknown>:0  lastJobGiver=PrisonLabor.JobGiver_Labor, curJob.def=TendPatient, curDriver=RimWorld.JobDriver_TendPatient


Can you please include prisoners into your mod's routine to make it compatible?

Does it already work for Hospitality guests who help your colony?

Sladki

The latest release (from Github) is not compatible with Pharmacy: when a pawn tries to tend, he chooses the best available medicine (Downgrade is disabled) ignoring Pharmacy "advice".

But there is a strange thing: I've tried to compile .dll from source and it works fine with Pharmacy (log shows, that SM prefix uses Pharmacy "advice" validator when tries to find the best medicine).

Uuugggg

Weird, I had rebuilt Smart Medicine to support Pharmacy because it didn't work; no reason it didn't work though.

Well there's a new version that seems to work.

EgotisticalElf

#52
I can confirm that Pharmacist and Smart Medicine do not play well on the currently posted 1.0 builds.

I had to rebuild the Pharmacist from source as it needed updated references from the game proper. I tried to recompile Smart Medicine with those same reference updates and with a few compile errors I think resolved, the game refused to load the mod at all.

*edit*
PickUpAndHaul adds items to the pawns inventory as it hauls up to their weight limit, however, this mod hides the ability to see what they have (the button and such is on top of the list i guess).

I lack the skillz to determine why though. :(

CH3N9

Current version conflict with Pick Up and Haul 1.0.2 on Rimworld v1.0.1978. Pawn pick up stuffs but doesn't drop 'em at the stockpiles unless I done it manually.

Could not execute post-long-event action. Exception: System.TypeInitializationException: An exception was thrown by the type initializer for PickUpAndHaul.HarmonyPatches ---> System.Exception: Exception from HarmonyInstance "mehni.rimworld.pickupthatcan.main" ---> System.ArgumentException: Object type System.Collections.Generic.List`1[Harmony.ILCopying.ExceptionBlock] cannot be converted to target type: System.Collections.Generic.List`1[Harmony.ILCopying.ExceptionBlock]
Parameter name: val
  at System.Reflection.MonoField.SetValue (System.Object obj, System.Object val, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Globalization.CultureInfo culture) [0x000e3] in /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoField.cs:152
  at Harmony.Traverse.SetValue (System.Object value) [0x00000] in <filename unknown>:0
  at Harmony.CodeTranspiler+<>c__DisplayClass4_0.<ConvertInstruction>b__0 (System.String name, Harmony.Traverse trvFrom, Harmony.Traverse trvDest) [0x00000] in <filename unknown>:0
  at Harmony.Traverse+<>c__DisplayClass37_0.<IterateFields>b__0 (System.String f) [0x00000] in <filename unknown>:0
  at System.Collections.Generic.List`1[System.String].ForEach (System.Action`1 action) [0x00018] in /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Collections.Generic/List.cs:361
  at Harmony.Traverse.IterateFields (System.Object source, System.Object target, System.Action`3 action) [0x00000] in <filename unknown>:0
  at Harmony.CodeTranspiler.ConvertInstruction (System.Type type, System.Object op, System.Collections.Generic.Dictionary`2& unassigned) [0x00000] in <filename unknown>:0
  at Harmony.CodeTranspiler.ConvertInstructionsAndUnassignedValues (System.Type type, IEnumerable enumerable, System.Collections.Generic.Dictionary`2& unassignedValues) [0x00000] in <filename unknown>:0
  at Harmony.CodeTranspiler.ConvertToGeneralInstructions (System.Reflection.MethodInfo transpiler, IEnumerable enumerable, System.Collections.Generic.Dictionary`2& unassignedValues) [0x00000] in <filename unknown>:0
  at Harmony.CodeTranspiler+<>c__DisplayClass10_0.<GetResult>b__0 (System.Reflection.MethodInfo transpiler) [0x00000] in <filename unknown>:0
  at System.Collections.Generic.List`1[System.Reflection.MethodInfo].ForEach (System.Action`1 action) [0x00018] in /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Collections.Generic/List.cs:361
  at Harmony.CodeTranspiler.GetResult (System.Reflection.Emit.ILGenerator generator, System.Reflection.MethodBase method) [0x00000] in <filename unknown>:0
  at Harmony.ILCopying.MethodBodyReader.FinalizeILCodes (System.Collections.Generic.List`1 transpilers, System.Collections.Generic.List`1 endLabels, System.Collections.Generic.List`1 endBlocks) [0x00000] in <filename unknown>:0
  at Harmony.ILCopying.MethodCopier.Finalize (System.Collections.Generic.List`1 endLabels, System.Collections.Generic.List`1 endBlocks) [0x00000] in <filename unknown>:0
  at Harmony.MethodPatcher.CreatePatchedMethod (System.Reflection.MethodBase original, System.String harmonyInstanceID, System.Collections.Generic.List`1 prefixes, System.Collections.Generic.List`1 postfixes, System.Collections.Generic.List`1 transpilers) [0x00000] in <filename unknown>:0
  --- End of inner exception stack trace ---
  at Harmony.MethodPatcher.CreatePatchedMethod (System.Reflection.MethodBase original, System.String harmonyInstanceID, System.Collections.Generic.List`1 prefixes, System.Collections.Generic.List`1 postfixes, System.Collections.Generic.List`1 transpilers) [0x00000] in <filename unknown>:0
  at Harmony.PatchFunctions.UpdateWrapper (System.Reflection.MethodBase original, Harmony.PatchInfo patchInfo, System.String instanceID) [0x00000] in <filename unknown>:0
  at Harmony.PatchProcessor.Patch () [0x00000] in <filename unknown>:0
  at Harmony.HarmonyInstance.Patch (System.Reflection.MethodBase original, Harmony.HarmonyMethod prefix, Harmony.HarmonyMethod postfix, Harmony.HarmonyMethod transpiler) [0x00000] in <filename unknown>:0
  at PickUpAndHaul.HarmonyPatches..cctor () [0x00000] in <filename unknown>:0
  --- 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) [0x00026] in /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Runtime.CompilerServices/RuntimeHelpers.cs:101
  at Verse.StaticConstructorOnStartupUtility.CallAll () [0x00022] in C:\Dev\RimWorld\Assets\Scripts\Verse\Utility\StaticConstructorOnStartup.cs:26
  at Verse.PlayDataLoader.<DoPlayLoad>m__2 () [0x00001] in C:\Dev\RimWorld\Assets\Scripts\Verse\Defs\Databases\PlayDataLoader.cs:279
  at Verse.LongEventHandler.ExecuteToExecuteWhenFinished () [0x00036] in C:\Dev\RimWorld\Assets\Scripts\Verse\Global\LongEventHandler.cs:489
Verse.Log:Error(String, Boolean) (at C:\Dev\RimWorld\Assets\Scripts\Verse\Utility\Debug\Log\Log.cs:78)
Verse.LongEventHandler:ExecuteToExecuteWhenFinished() (at C:\Dev\RimWorld\Assets\Scripts\Verse\Global\LongEventHandler.cs:493)
Verse.LongEventHandler:UpdateCurrentAsynchronousEvent() (at C:\Dev\RimWorld\Assets\Scripts\Verse\Global\LongEventHandler.cs:402)
Verse.LongEventHandler:LongEventsUpdate(Boolean&) (at C:\Dev\RimWorld\Assets\Scripts\Verse\Global\LongEventHandler.cs:257)
Verse.Root:Update_Patch1(Object)
Verse.Root_Entry:Update() (at C:\Dev\RimWorld\Assets\Scripts\Verse\Global\Root\Root_Entry.cs:38)

Kassidoo

Hi, it seems something broke SmartMedicine today in my game (B19)
https://gist.github.com/HugsLibRecordKeeper/dc1d82931009672417af256e25a35ad5

heres a snipet

Isildria threw exception in WorkGiver DoctorTendToHumanlikes: System.NullReferenceException: Object reference not set to an instance of an object
at SmartMedicine.Settings.Get () <0x00022>
at SmartMedicine.GoodLayingStatusForTend_Patch.Postfix (Verse.Pawn,bool&) <0x00031>
at (wrapper dynamic-method) RimWorld.WorkGiver_Tend.GoodLayingStatusForTend_Patch1 (Verse.Pawn,Verse.Pawn) <0x000c2>
at RimWorld.WorkGiver_Tend.HasJobOnThing (Verse.Pawn,Verse.Thing,bool) <0x00103>
at RimWorld.WorkGiver_TendOther.HasJobOnThing (Verse.Pawn,Verse.Thing,bool) <0x00032>
at RimWorld.JobGiver_Work/<TryIssueJobPackage>c__AnonStorey1.<>m__0 (Verse.Thing) <0x0005e>
at Verse.GenClosest/<ClosestThingReachable>c__AnonStorey0.<>m__0 (Verse.Thing) <0x000fa>
at Verse.GenClosest.ClosestThing_Global (Verse.IntVec3,System.Collections.IEnumerable,single,System.Predicate`1<Verse.Thing>,System.Func`2<Verse.Thing, single>) <0x00214>
at Verse.GenClosest.ClosestThingReachable (Verse.IntVec3,Verse.Map,Verse.ThingRequest,Verse.AI.PathEndMode,Verse.TraverseParms,single,System.Predicate`1<Verse.Thing>,System.Collections.Generic.IEnumerable`1<Verse.Thing>,int,int,bool,Verse.RegionType,bool) <0x00504>
at (wrapper dynamic-method) RimWorld.JobGiver_Work.TryIssueJobPackage_Patch1 (object,Verse.Pawn,Verse.AI.JobIssueParams) <0x0131b>


Uuugggg

Updated for official B19, problems seem to be fixed

deliveryservice

#56
I get this warning:
Tried to use an uninitialized DefOf of type StatDefOf. DefOfs are initialized right after all defs all loaded. Uninitialized DefOfs will return only nulls. (hint: don't use DefOfs as default field values in Defs, try to resolve them in ResolveReferences() instead)
Verse.Log:Warning(String, Boolean)
RimWorld.DefOfHelper:EnsureInitializedInCtor(Type)
RimWorld.StatDefOf:.cctor()
System.RuntimeMethodHandle:GetFunctionPoi


This is mild but it may leads to complication after more mods were added.

bigheadzach

So I have a prisoner develop an infected injury (2% higher than immunity at the time) and my colony only has standard medicine, no herbal. Both Smart Medicine and Pharmacist are set to their initial settings, which suggest that even a prisoner should get standard meds for a life-threatening injury (which an infection leading immunity would be).

Yet, the doctor applies no medicine to tending the infection. The only way I "fixed" this was cranking both Pharmacist and the prisoner's personal vanilla settings from "Herbal" to "Best Possible".

Am I seeing a bug, or am I misunderstanding how SM determines the use of standard meds? Is there a logic that gives up when "Herbal or worse" is the setting and only "Better than Herbal or nothing" is available?

Soupy Delicious

Wow, looks like a really well thought out mod.  I'd be interested, if you'd update :D

shadowstitch

Could I suggest the option to disable the "use best medicine for surgery" toggle in the pawn -> health -> overview panel?
In my game at least, it causes "metabolism" at the bottom of the list to be halfway cut off by the bottom bar of the screen. And I believe this option is toggle-able elsewhere, so there's already some redundancy there.