RimWorld

RimWorld

Adaptive Storage - Global Settings
 This topic has been pinned, so it's probably important
NuanKi  [developer] Jul 20 @ 6:41pm
Bug Reports
When reporting bugs or mod conflicts, please always upload your log file via HugsLib Log Publisher (press Ctrl + F12 directly after the problem happened) and include the link in your message. Without a log file there is no way for me to figure out what exactly is wrong or how to fix it.
Last edited by NuanKi; Aug 24 @ 8:58am
< >
Showing 1-14 of 14 comments
RedFlag Jul 23 @ 5:56am 
error happend after apply change for 2*1 Firdge (Reel's Expanded Storage)

<noparse>
Initializing new game with mods:
- brrainz.harmony
- Ludeon.RimWorld
- ka.betterlog
- imranfish.xmlextensions
- Ludeon.RimWorld.Royalty
- Ludeon.RimWorld.Ideology
- Ludeon.RimWorld.Biotech
- Ludeon.RimWorld.Anomaly
- Ludeon.RimWorld.Odyssey
- local.normalPost
- UnlimitedHugs.HugsLib
- adaptive.storage.framework
- NuanKi.AdaptiveStorageGlobalSettings
- OskarPotocki.VanillaFactionsExpanded.Core
- sbz.NeatStorage
- NuanKi.AdaptiveStorageGlobalSettings.zh
- VanillaExpanded.VFEPropsandDecor
- reel.expanded.storage
Unloading 0 Unused Serialized files (Serialized files now loaded: 5)
Unloading 1 unused Assets to reduce memory usage. Loaded Objects now: 37022.
Total: 215.211666 ms (FindLiveObjects: 0.993375 ms CreateObjectMapping: 0.845459 ms MarkObjects: 213.333750 ms DeleteObjects: 0.038833 ms)

Exception filling window for AdaptiveStorageGlobalSettings.Dialog_BuildingSettings: System.InvalidCastException: Specified cast is not valid.
[Ref 2E795985]
at AdaptiveStorageGlobalSettings.Dialog_BuildingSettings.FiltersAreEqual (Verse.ThingFilter filterA, Verse.ThingFilter filterB) [0x00074] in <26a78dbbd8604183b350e156aad3d730>:0
at AdaptiveStorageGlobalSettings.Dialog_BuildingSettings.ApplyChanges () [0x000cb] in <26a78dbbd8604183b350e156aad3d730>:0
at AdaptiveStorageGlobalSettings.Dialog_BuildingSettings.DoWindowContents (UnityEngine.Rect inRect) [0x0016d] in <26a78dbbd8604183b350e156aad3d730>:0
at Verse.Window.InnerWindowOnGUI (System.Int32 x) [0x001a6] in <b46fda05e8a84d2bad4ab1b9fab01a22>:0
<noparse>
NuanKi  [developer] Jul 23 @ 8:57am 
Will fix shortly
NuanKi  [developer] Jul 23 @ 10:27am 
Fixed!
RedFlag Jul 23 @ 9:43pm 
Originally posted by NuanKi:
Fixed!
thank you
Error in static constructor of AdaptiveStorageGlobalSettings.ASGS_Initializer: System.TypeInitializationException: The type initializer for 'AdaptiveStorageGlobalSettings.ASGS_Initializer' threw an exception. ---> System.NullReferenceException: Object reference not set to an instance of an object
at PerishableSpoilTimeFilter.HarmonyPatches.CopyAllowancesFrom_Postfix (Verse.ThingFilter __instance, Verse.ThingFilter other) [0x00005] in <db47d763c3fe47d686085fb6fe83acee>:0
at (wrapper dynamic-method) MonoMod.Utils.DynamicMethodDefinition.Verse.ThingFilter.CopyAllowancesFrom_Patch1(Verse.ThingFilter,Verse.ThingFilter)
at AdaptiveStorageGlobalSettings.ASGS_Initializer.InitializeAndApplySettings () [0x0017e] in <6aef07ebe62f450c88ecc16058ef6399>:0
at AdaptiveStorageGlobalSettings.ASGS_Initializer..cctor () [0x00001] in <6aef07ebe62f450c88ecc16058ef6399>:0
--- End of inner exception stack trace ---
[Ref 1D28A05C]
(wrapper managed-to-native) System.RuntimeMethodHandle.GetFunctionPointer(intptr)
at System.RuntimeMethodHandle.GetFunctionPointer () [0x00000] in <51fded79cd284d4d911c5949aff4cb21>:0
at HarmonyLib.HarmonySharedState.GetRealMethod (System.Reflection.MethodInfo method, System.Boolean useReplacement) [0x00046] in <8124cc12bdf242eab0a5f7e7edecf387>:0
at HarmonyLib.HarmonySharedState.GetStackFrameMethod (System.Diagnostics.StackFrame frame, System.Boolean useReplacement) [0x00015] in <8124cc12bdf242eab0a5f7e7edecf387>:0
at HarmonyLib.Harmony.GetOriginalMethodFromStackframe (System.Diagnostics.StackFrame frame) [0x0000e] in <8124cc12bdf242eab0a5f7e7edecf387>:0
at HarmonyMod.ExceptionTools.AddHarmonyFrames (System.Text.StringBuilder sb, System.Diagnostics.StackTrace trace) [0x00026] in <a673461a8ef1414ca7b7ebde5c7c6ef9>:0
at HarmonyMod.ExceptionTools.ExtractHarmonyEnhancedStackTrace (System.Diagnostics.StackTrace trace, System.Boolean forceRefresh, System.Int32& hash) [0x00040] in <a673461a8ef1414ca7b7ebde5c7c6ef9>:0
at HarmonyMod.Environment_GetStackTrace_Patch.Prefix (System.Exception e, System.Boolean needFileInfo, System.String& __result) [0x0001d] in <a673461a8ef1414ca7b7ebde5c7c6ef9>:0
UnityEngine.StackTraceUtility:ExtractStackTrace ()
(wrapper dynamic-method) MonoMod.Utils.DynamicMethodDefinition:Verse.Log.Error_Patch1 (string)
(wrapper dynamic-method) MonoMod.Utils.DynamicMethodDefinition:Verse.StaticConstructorOnStartupUtility.CallAll_Patch4 ()
Verse.PlayDataLoader/<>c:<DoPlayLoad>b__4_4 ()
Verse.LongEventHandler:ExecuteToExecuteWhenFinished ()
Verse.LongEventHandler:UpdateCurrentAsynchronousEvent ()
Verse.LongEventHandler:LongEventsUpdate (bool&)
(wrapper dynamic-method) MonoMod.Utils.DynamicMethodDefinition:Verse.Root.Update_Patch1 (Verse.Root)
Verse.Root_Entry:Update ()

Seems like Perishable Spoil Time Filter breaks your mod.
It errors during play, and on load.
Also stops the entire Settings GUI to fail.
NuanKi  [developer] Jul 29 @ 11:27am 
Originally posted by Bobbysepp:
Error in static constructor of AdaptiveStorageGlobalSettings.ASGS_Initializer: System.TypeInitializationException: The type initializer for 'AdaptiveStorageGlobalSettings.ASGS_Initializer' threw an exception. ---> System.NullReferenceException: Object reference not set to an instance of an object
at PerishableSpoilTimeFilter.HarmonyPatches.CopyAllowancesFrom_Postfix (Verse.ThingFilter __instance, Verse.ThingFilter other) [0x00005] in <db47d763c3fe47d686085fb6fe83acee>:0
at (wrapper dynamic-method) MonoMod.Utils.DynamicMethodDefinition.Verse.ThingFilter.CopyAllowancesFrom_Patch1(Verse.ThingFilter,Verse.ThingFilter)
at AdaptiveStorageGlobalSettings.ASGS_Initializer.InitializeAndApplySettings () [0x0017e] in <6aef07ebe62f450c88ecc16058ef6399>:0
at AdaptiveStorageGlobalSettings.ASGS_Initializer..cctor () [0x00001] in <6aef07ebe62f450c88ecc16058ef6399>:0
--- End of inner exception stack trace ---
[Ref 1D28A05C]
(wrapper managed-to-native) System.RuntimeMethodHandle.GetFunctionPointer(intptr)
at System.RuntimeMethodHandle.GetFunctionPointer () [0x00000] in <51fded79cd284d4d911c5949aff4cb21>:0
at HarmonyLib.HarmonySharedState.GetRealMethod (System.Reflection.MethodInfo method, System.Boolean useReplacement) [0x00046] in <8124cc12bdf242eab0a5f7e7edecf387>:0
at HarmonyLib.HarmonySharedState.GetStackFrameMethod (System.Diagnostics.StackFrame frame, System.Boolean useReplacement) [0x00015] in <8124cc12bdf242eab0a5f7e7edecf387>:0
at HarmonyLib.Harmony.GetOriginalMethodFromStackframe (System.Diagnostics.StackFrame frame) [0x0000e] in <8124cc12bdf242eab0a5f7e7edecf387>:0
at HarmonyMod.ExceptionTools.AddHarmonyFrames (System.Text.StringBuilder sb, System.Diagnostics.StackTrace trace) [0x00026] in <a673461a8ef1414ca7b7ebde5c7c6ef9>:0
at HarmonyMod.ExceptionTools.ExtractHarmonyEnhancedStackTrace (System.Diagnostics.StackTrace trace, System.Boolean forceRefresh, System.Int32& hash) [0x00040] in <a673461a8ef1414ca7b7ebde5c7c6ef9>:0
at HarmonyMod.Environment_GetStackTrace_Patch.Prefix (System.Exception e, System.Boolean needFileInfo, System.String& __result) [0x0001d] in <a673461a8ef1414ca7b7ebde5c7c6ef9>:0
UnityEngine.StackTraceUtility:ExtractStackTrace ()
(wrapper dynamic-method) MonoMod.Utils.DynamicMethodDefinition:Verse.Log.Error_Patch1 (string)
(wrapper dynamic-method) MonoMod.Utils.DynamicMethodDefinition:Verse.StaticConstructorOnStartupUtility.CallAll_Patch4 ()
Verse.PlayDataLoader/<>c:<DoPlayLoad>b__4_4 ()
Verse.LongEventHandler:ExecuteToExecuteWhenFinished ()
Verse.LongEventHandler:UpdateCurrentAsynchronousEvent ()
Verse.LongEventHandler:LongEventsUpdate (bool&)
(wrapper dynamic-method) MonoMod.Utils.DynamicMethodDefinition:Verse.Root.Update_Patch1 (Verse.Root)
Verse.Root_Entry:Update ()

Seems like Perishable Spoil Time Filter breaks your mod.
It errors during play, and on load.
Also stops the entire Settings GUI to fail.

Indeed, the problem is in the other mod itself.

The Harmony patch they added to modify CopyAllowancesFrom is:

public static void CopyAllowancesFrom_Postfix(ThingFilter __instance, ThingFilter other) { MyWorldComponent world = Find.World.GetComponent<MyWorldComponent>(); if (!world.ShowSpoilTime(__instance) || !world.ShowSpoilTime(other)) return; ref IntRange local = ref world.getSpoilTime(__instance); local = world.getSpoilTime(other); }

This patch modifies the vanilla CopyAllowancesFrom method, making it only work when a world is loaded. This causes a crash when it tries to run CopyAllowancesFrom during the initial game startup, this is the part that does it:

MyWorldComponent world = Find.World.GetComponent<MyWorldComponent>();

This, in turn, breaks my mod, since my mod calls CopyAllowancesFrom during the initial game startup (before a world is loaded), which triggers the crash in their patch.

They can fix this by adding a safety check that they already use in the ExposeData_Postfix method:

if (Find.World == null) return;
Last edited by NuanKi; Jul 29 @ 11:40am
NuanKi  [developer] Jul 29 @ 11:39am 
So probably I will add an incompatibility tag for it
And I'll go and bring this to their attention.
bonesbro Aug 20 @ 6:42pm 
I've been having trouble with a Pot. I configured it using the settings to add an additional type of item that could be stored in it. It works fine until I restart the game. When I load my map the pot's storage window is empty - it has the controls at the top but there are no items listed in the category. Opening your mod settings, opening the Pot, and hitting Accept fixes the issue until the next game restart. There are no obvious errors in the debug console or hugslib and these log statements look like it's being applied when it loads:

[Adaptive Storage - Global Settings] Initializing...
[Adaptive Storage - Global Settings] Caching complete. Found 151 compatible buildings.
[Adaptive Storage - Global Settings] Applied 0 stack, 1 filter, 0 category, and 0 power overrides from saved settings.

Def: BasicStorageStonePot
Mod: Phaneron's Basic Storage
Huglib: https://gist.github.com/HugsLibRecordKeeper/d8643b4bf648e97acf7712f1bf60e0cd
NuanKi  [developer] Aug 20 @ 8:24pm 
Mmm, that indeed is a weird and very specific bug, I will look into it, thanks for the report
NuanKi  [developer] Aug 20 @ 9:57pm 
Fixed!
Splaetos Aug 24 @ 3:23pm 
I am having issues with the UI and storage parameters. I noticed right away when copying and pasting, things weren't working quite right, but I managed to get the filters to look as I intended eventually. Later, however, I noticed that things had no really worked right. For instance, "Pallet" from Neat Storage only shows weapons and apparel, or sometimes nothing at all, after tweaking the filter. Resetting the filter instantly reverts it to a proper working condition (so far as I can tell). Also in the Options UI, the filter window can break and only show a limited portion of the list, or sometimes the scroll bar will even disappear.

https://gist.github.com/HugsLibRecordKeeper/3587c2fa5eee228bfb3eb7657bcf77cb
NuanKi  [developer] Aug 24 @ 4:38pm 
Originally posted by Splaetos:
I am having issues with the UI and storage parameters. I noticed right away when copying and pasting, things weren't working quite right, but I managed to get the filters to look as I intended eventually. Later, however, I noticed that things had no really worked right. For instance, "Pallet" from Neat Storage only shows weapons and apparel, or sometimes nothing at all, after tweaking the filter. Resetting the filter instantly reverts it to a proper working condition (so far as I can tell). Also in the Options UI, the filter window can break and only show a limited portion of the list, or sometimes the scroll bar will even disappear.

https://gist.github.com/HugsLibRecordKeeper/3587c2fa5eee228bfb3eb7657bcf77cb

1.- For the scrollbar:
This is a visual bug caused by a quirk in the vanilla game's UI. The game uses a single shared state for all filter windows. If you have an in-game "Storage" tab open with all of its categories collapsed, the game decides it doesn't need a scrollbar and saves that state. When you open my mod settings filter, it reads this pre-existing state and, since the state is already defined, it doesn't recalculate, causing it to incorrectly draw itself without a scrollbar or incomplete scrollbar.

Solution: Dont open any tab with a filter (storage tab) while trying to configure the filter in the mod settings


2.- For the Filter:
There are two types of storage buildings: those with a <fixedStorageSettings> defined in their code, and those without. This mod works by modifying these fixed settings. For buildings that already have them, changes apply instantly. For buildings that lack them, the mod must create a new settings block from scratch, which requires a quick save and reload to apply to existing buildings in map.

Solution: Save and reload (No Game restart required)


In this case i just checked Neat Storage pallet, and it does not have a fixedStorage Setting (Allows everything by default), so it needs a quick save and reload to aply the filter, after that is created you can change it normally without saving and reloading
Last edited by NuanKi; Aug 24 @ 4:41pm
Splaetos Aug 25 @ 6:07pm 
Thanks, that explains much. I am still having intermittent issues. Phaneron's food barrel, for instance, was refusing to show any filters, no matter what I did then suddenly it worked. A reload later, the stack setting was applied. When I go back into the options though, it shows a different filter than what is currently applied (ie Hay is re-allowed) but as long as I don't hit accept, it seems not to matter. I can work around these small oddities. Thank you very much for this mod. Some of the buildings made for the framework have insane settings.
< >
Showing 1-14 of 14 comments
Per page: 1530 50