[1.0] Smarter Food Selection, Hydroponics with lamps and more...

Started by Wishmaster, February 20, 2017, 05:34:05 PM

Previous topic - Next topic

Wishmaster

I think about this but that may limit the possibility to have custom policies.
I plan to change the UI anyway and maybe move it to the restrict tab/ assign tab or even a new root tab.

wenify

#76
Hi, new player here. I must say that Too Many Leathers is one of the most useful mods I have used. It works wonderfully, however, I have encountered a bug/clash few times in conjunction with the hospitality mod.

So, when visitors are happy with the stay they leave gifts behind(hospitality mod), sometimes leathers. The leather would not be converted until after the game is loaded again. All is fine until one of the haulers come and try to haul it away. Error occurs and the hauler would freeze near the leather and give up on the task, then another hauler would come over...The attached image shows the debug log, with the leather in question selected. As you can see there is an item name mismatch. The last line ("the given key was not present in the dictionary") is what happens when I try to destroy the leather.

Sometimes the leather would disappear after loading, sometimes it would be fine. I am reporting this because recently it just crashed my save upon loading. I am not sure if the problem can be solved by simply switching the order of the mods; maybe load Too Many Leathers first. I have rearranged the order and will see what happens. Thanks!

Edit: Clarification: after the save crashed I loaded an earlier save and was able to reproduce the same gifts, saved and loaded, that's how I got the screenshot. I S/L again afterward, and the leather disappeared.

[attachment deleted by admin due to age]

PreDiabetic

Smarter food selection makes Needs section HUGE because of that you can't see upperside of that. I had to disable to see mood,rest etc. And Is there a way to FORCE colonist to use DISPENSER instead of meals?

Wishmaster

#78
Quote from: wenify on March 29, 2017, 10:09:51 PM
Hi, new player here. I must say that Too Many Leathers is one of the most useful mods I have used. It works wonderfully, however, I have encountered a bug/clash few times in conjunction with the hospitality mod.

So, when visitors are happy with the stay they leave gifts behind(hospitality mod), sometimes leathers. The leather would not be converted until after the game is loaded again. All is fine until one of the haulers come and try to haul it away. Error occurs and the hauler would freeze near the leather and give up on the task, then another hauler would come over...The attached image shows the debug log, with the leather in question selected. As you can see there is an item name mismatch. The last line ("the given key was not present in the dictionary") is what happens when I try to destroy the leather.

Sometimes the leather would disappear after loading, sometimes it would be fine. I am reporting this because recently it just crashed my save upon loading. I am not sure if the problem can be solved by simply switching the order of the mods; maybe load Too Many Leathers first. I have rearranged the order and will see what happens. Thanks!

Edit: Clarification: after the save crashed I loaded an earlier save and was able to reproduce the same gifts, saved and loaded, that's how I got the screenshot. I S/L again afterward, and the leather disappeared.

Thank you for your support and for reporting this.
I would need the complete log or at least the detailed information about the errors.

Too Many Leathers does not delete any leathers definition but will replace what animals drop when butchered instead, so visitors, traders still have some of those vanilla leathers.

If everything works fine too, you should be prompted when loading a game if the world has any discarded leather somewhere. Were those leathers already converted ?

Quote from: damngrl on March 30, 2017, 06:05:58 AM
Smarter food selection makes Needs section HUGE because of that you can't see upperside of that. I had to disable to see mood,rest etc. And Is there a way to FORCE colonist to use DISPENSER instead of meals?

It is not up to date here... unlike it is on steam. Fixing this ! The updated version fixes that UI issue.
You can, select the policy "Meals only (worst 1st)". You may not see it for now as the standalone version was not updated.

PreDiabetic

"I did not want to create a new inspector tab (on the bottom left) because the maximum is 6."
Is this the HealthTab,Need,Character tab? If it is my quests have 7 Tab.

                                                   ,Guest
Psyche,Social,Gear,Character,Need,Health

My tab is like this.

Wishmaster

Quote from: damngrl on March 30, 2017, 08:19:29 AM
"I did not want to create a new inspector tab (on the bottom left) because the maximum is 6."
Is this the HealthTab,Need,Character tab? If it is my quests have 7 Tab.

                                                   ,Guest
Psyche,Social,Gear,Character,Need,Health

My tab is like this.

Uh, really ?
I swear that the vanilla maximum is 6.

... I just had a look at this and actually, psychology does override this limit, just like SFS now does.

So having both mods will NOT create conflicts but will print an error message on start (harmless).

Now the way the tabs are drawn will depend which of both mods is loaded first. Chose the one you prefer !

(When I first tried to add a "food" tab I did not want to take the risk to change how the tabs are drawn but potential conflict purposes, changed my mind since then.)

Psychology way



Smarter Food Selection Way




PreDiabetic

[HugsLib] Exception during DetourMethodByAttribute: System.Exception: Failed to detour method InspectPaneUtility.DoTabs to InspectPaneUtility.DoTabs (assembly: WM Smarter Food Selection) ---> System.Exception: method was already detoured to Psychology.Detour._InspectPaneUtility._DoTabs.
  at HugsLib.Source.Detour.DetourProvider.CompatibleDetourWithExceptions (System.Reflection.MethodInfo source, System.Reflection.MethodInfo destination) [0x00000] in <filename unknown>:0
  at HugsLib.Source.Detour.Helpers.DetourMethodByAttribute (System.Reflection.MemberInfo info, System.Attribute attrib) [0x00000] in <filename unknown>:0
  --- End of inner exception stack trace ---
  at HugsLib.Source.Detour.DetourProvider.ThrowClearerDetourException (System.Exception e, System.Reflection.MemberInfo sourceInfo, System.Reflection.MemberInfo targetInfo, System.String detourMode) [0x00000] in <filename unknown>:0
  at HugsLib.Source.Detour.Helpers.DetourMethodByAttribute (System.Reflection.MemberInfo info, System.Attribute attrib) [0x00000] in <filename unknown>:0
Verse.Log:Error(String)
HugsLib.Utils.ModLogger:ReportException(Exception, String, Boolean, String)
HugsLib.Source.Detour.Helpers:DetourMethodByAttribute(MemberInfo, Attribute)
HugsLib.Source.Attrib.AttributeDetector:CallHandlersForAttributes(List`1, Dictionary`2)
HugsLib.Source.Attrib.AttributeDetector:ProcessNewTypes()
HugsLib.HugsLibController:ProcessAttibutes()
HugsLib.HugsLibController:LoadReloadInitialize()
HugsLib.HugsLibController:Initalize()
HugsLib.Core.UnityProxyComponent:Start()


Is this harmless one?


sadris

Can you tell me what is going on?

It says he wants to eat nutrient paste, yet he is currently eating Baked Polenta... It seems they pick up polenta to keep one food in their inventory, then end up eating their inventory food instead of the acceptable Paste.



Wishmaster

That current best food thing in UI is a bit broken...

They will eat what's in inventory first.
What I wonder is why he picked this in inventory. Did he when he had nutrient paste to eat ?

wenify

Sorry for the late reply. Here is the error (images with more details attached):

JobDriver threw exception in initAction. Pawn=Blackjack, Job=HaulToCell A=Thing_Cougar_Leather1158578 B=(133, 0, 62), Exception: System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
  at System.Collections.Generic.Dictionary`2[Verse.ThingDef,System.Collections.Generic.List`1[Verse.Thing]].get_Item (Verse.ThingDef key) [0x00000] in <filename unknown>:0
  at Verse.ListerThings.Remove (Verse.Thing t) [0x00000] in <filename unknown>:0
  at Verse.Thing.DeSpawn () [0x00000] in <filename unknown>:0
  at Verse.ThingWithComps.DeSpawn () [0x00000] in <filename unknown>:0
  at Verse.Thing.SplitOff (Int32 count) [0x00000] in <filename unknown>:0
  at Verse.ThingWithComps.SplitOff (Int32 count) [0x00000] in <filename unknown>:0
  at Verse.ThingContainer.TryAdd (Verse.Thing item, Int32 count) [0x00000] in <filename unknown>:0
  at Verse.Pawn_CarryTracker.TryStartCarry (Verse.Thing item, Int32 count) [0x00000] in <filename unknown>:0
  at Verse.AI.Toils_Haul+<StartCarryThing>c__AnonStorey41A.<>m__67B () [0x00000] in <filename unknown>:0
  at Verse.AI.JobDriver.TryActuallyStartNextToil () [0x00000] in <filename unknown>:0
Verse.Log:Error(String)
Verse.AI.JobDriver:TryActuallyStartNextToil()
Verse.AI.JobDriver:ReadyForNextToil()
Verse.AI.JobDriver:Notify_PatherArrived()
Verse.AI.Pawn_PathFollower:PatherArrived()
Verse.AI.Pawn_PathFollower:TryEnterNextPathCell()
Verse.AI.Pawn_PathFollower:PatherTick()
Verse.Pawn:Tick()
Verse.TickList:Tick()
Verse.TickManager:DoSingleTick()
Verse.TickManager:TickManagerUpdate()
Verse.Game:Update()
Verse.Root_Play:Update()

[attachment deleted by admin due to age]

wenify

Another example, and what happens when loading the save with converted leather.
Edit: you can see that the leathers have been converted. But error shows the leather being completely different things
(ie. Bearskin to muffalo leather, and catskin to cougar leather)

[attachment deleted by admin due to age]


ZLF

<ControlColonists>Enable control over colonists</ControlColonists>
<ControlColonists_desc>Enable control over colonists</ControlColonists_desc>
<ControlVisitors>Enable control over visitors</ControlVisitors>
<ControlColonists_desc>If disabled, visitors will use their vanilla behavior.</ControlColonists_desc>

The description label of 'ControlVisitors' seems to be mistyped.
I also got a yellow warning below:
QuoteType Resources probably needs a StaticConstructorOnStartup attribute, because it has a field NutrientPaste of type Texture2D. All assets must be loaded in the main thread.
It seems harmless, just a bit annoying.

Wishmaster

Quote from: ZLF on March 31, 2017, 09:19:55 AM
   <ControlColonists>Enable control over colonists</ControlColonists>
   <ControlColonists_desc>Enable control over colonists</ControlColonists_desc>
   <ControlVisitors>Enable control over visitors</ControlVisitors>
   <ControlColonists_desc>If disabled, visitors will use their vanilla behavior.</ControlColonists_desc>

The description label of 'ControlVisitors' seems to be mistyped.
I also got a yellow warning below:
QuoteType Resources probably needs a StaticConstructorOnStartup attribute, because it has a field NutrientPaste of type Texture2D. All assets must be loaded in the main thread.
It seems harmless, just a bit annoying.

Good find, thank you !