[A16] Psychology (2017-5-14)

Started by System.Linq, August 19, 2016, 07:16:38 AM

Previous topic - Next topic

biship

Quote from: Fightera100 on April 15, 2017, 12:18:20 PM
Seems like it doesn't work with Hospitality :/

[HugsLib] Exception during DetourMethodByAttribute: System.Exception: Failed to detour method Pawn_RelationsTracker.Notify_RescuedBy to _Pawn_RelationsTracker._Notify_RescuedBy (assembly: Psychology) ---> System.Exception: method was already detoured to Hospitality.Detouring.Pawn_RelationsTracker.Notify_RescuedBy.
  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()


I get the same error. Perhaps is a load order issue. My order is:

Core
HugsLib
Hospitality
Psychology

Holothurin

#556
I don't want to sound overly pissed but the following just happened again due to an Ex-Lover Couple:

<social>
<directRelations>
<li>
<def>PawnRelationDynamic</def>
<otherPawn>Thing_Human5522</otherPawn>
<startTicks>1455660</startTicks>
</li>
<li Class="Psychology.DirectPawnRelationDynamic">
<def>PawnRelationDynamic</def>
<otherPawn>Thing_Human5522</otherPawn>
<startTicks>1455660</startTicks>
<thing Class="Psychology.PsychologyPawn">
<def>Human</def>
<id>Human5509</id>


The <social> and <directrelations> tags finish after including all plants/shrubs at the end of the file rendering pretty much every savegame useless. That's the fifth colony I have to give up due to that  :-\
I would have tried to simply replace 'PawnRelationDynamic' but even then everything referring to the pawn after that like skills, etc. has not been written into the save anymore.

Swolebob

Quote from: Holothurin on April 16, 2017, 10:38:23 AM
I don't want to sound overly pissed but the following just happened again due to an Ex-Lover Couple:

<social>
<directRelations>
<li>
<def>PawnRelationDynamic</def>
<otherPawn>Thing_Human5522</otherPawn>
<startTicks>1455660</startTicks>
</li>
<li Class="Psychology.DirectPawnRelationDynamic">
<def>PawnRelationDynamic</def>
<otherPawn>Thing_Human5522</otherPawn>
<startTicks>1455660</startTicks>
<thing Class="Psychology.PsychologyPawn">
<def>Human</def>
<id>Human5509</id>


The <social> and <directrelations> tags finish after including all plants/shrubs at the end of the file rendering pretty much every savegame useless. That's the fifth colony I have to give up due to that  :-\
I would have tried to simply replace 'PawnRelationDynamic' but even then everything referring to the pawn after that like skills, etc. has not been written into the save anymore.

I just lost my second colony today for the same reason :/

biship

Good effort on this mod, however it's too buggy for me to use. Thanks for the effort.

sidfu

Quote from: Holothurin on April 16, 2017, 10:38:23 AM
I don't want to sound overly pissed but the following just happened again due to an Ex-Lover Couple:

<social>
<directRelations>
<li>
<def>PawnRelationDynamic</def>
<otherPawn>Thing_Human5522</otherPawn>
<startTicks>1455660</startTicks>
</li>
<li Class="Psychology.DirectPawnRelationDynamic">
<def>PawnRelationDynamic</def>
<otherPawn>Thing_Human5522</otherPawn>
<startTicks>1455660</startTicks>
<thing Class="Psychology.PsychologyPawn">
<def>Human</def>
<id>Human5509</id>


The <social> and <directrelations> tags finish after including all plants/shrubs at the end of the file rendering pretty much every savegame useless. That's the fifth colony I have to give up due to that  :-\
I would have tried to simply replace 'PawnRelationDynamic' but even then everything referring to the pawn after that like skills, etc. has not been written into the save anymore.


that error is probaly being caused by this error hugslib is throwing on psycology

[HugsLib] Exception during DetourMethodByAttribute: System.Exception: Failed to detour method Pawn_RelationsTracker.Notify_RescuedBy to _Pawn_RelationsTracker._Notify_RescuedBy (assembly: Psychology) ---> System.Exception: method was already detoured to Hospitality.Detouring.Pawn_RelationsTracker.Notify_RescuedBy.
  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()


Holothurin

I had to remove psychology although I do miss the interactions and now everything runs fine. No more corrupted saves.
Maybe the pawnrelation dynamics were a bit too dynamic anyway. I had a divorce rate of 100% and almost no marriage lasting longer than one season resulting in multiple debuffs. Sometimes these things happened so fast, the pawns had more than one divorce-debuff at the time. This was actually worse than an everlasting psychic wave :)

System.Linq

Hello,

The error you receive from Hospitality is superficial and can be safely ignored. The ex-lover save corrupting issue has no clear cause and it's been incredibly difficult to find anyone who can help me test it (contrary to Holothurin's experience,  the pawns in my colony absolutely refuse to break up). I have an update in the works but would prefer to ensure that the dynamic relations bug is fixed before releasing it.

Thanks.

Holothurin

Well, the last time I did something with C++ was back in 2001 so i'm not of much help here. What exactly would you like to test out though since my colonists seem rather fond of breaking up?

KarpatMan

    Hi, I have a problem. I can`t see any new interactions between colonists like "Talked about Morale +2", etc. Back when I got old Hospitality everything ran fine(but Hospitality was bugged that days :D). Any help?
P.S. also gettin ex-lover Error messages in console

Crossbowman

Quote from: Linq on April 24, 2017, 08:02:07 PM
Hello,

The error you receive from Hospitality is superficial and can be safely ignored. The ex-lover save corrupting issue has no clear cause and it's been incredibly difficult to find anyone who can help me test it (contrary to Holothurin's experience,  the pawns in my colony absolutely refuse to break up). I have an update in the works but would prefer to ensure that the dynamic relations bug is fixed before releasing it.

Thanks.
I think one way to test it would be to set up a bunch of pawns in a room (with food and heating etc), and then make a ton of them lover-pairs (or husband-wife + cheaters). Assuming none are polyamorous, they will inevitably break up due to bad relations.

JustAHuman1989

Anybody is here? I`ve got an error while playing. I don`t know what is wrong because my poor english and lack of understanding how mods are working. maybe it is some sort of unstackable mod i got? the game is pausing all the time, but it was not some time ago. everything is running good, exept this problem.

System.NullReferenceException: Object reference not set to an instance of an object
at Psychology._LovePartnerRelationUtility._LovePartnerRelationGenerationChance (Verse.Pawn,Verse.Pawn,Verse.PawnGenerationRequest,bool) <0x00304>
at (wrapper dynamic-method) RimWorld.PawnRelationWorker_Spouse.GenerationChance_Patch1 (object,Verse.Pawn,Verse.Pawn,Verse.PawnGenerationRequest) <0x00036>
at Verse.PawnGenerator/<GeneratePawnRelations>c__AnonStorey4B2.<>m__7C5 (System.Collections.Generic.KeyValuePair`2<Verse.Pawn, RimWorld.PawnRelationDef>) <0x00086>
at Verse.GenCollection.RandomElementByWeightWithDefault<System.Collections.Generic.KeyValuePair`2<Verse.Pawn, RimWorld.PawnRelationDef>> (System.Collections.Generic.IEnumerable`1<System.Collections.Generic.KeyValuePair`2<Verse.Pawn, RimWorld.PawnRelationDef>>,System.Func`2<System.Collections.Generic.KeyValuePair`2<Verse.Pawn, RimWorld.PawnRelationDef>, single>,single) <0x000cc>
at (wrapper dynamic-method) Verse.PawnGenerator.GeneratePawnRelations_Patch1 (Verse.Pawn,Verse.PawnGenerationRequest&) <0x0040d>
at Verse.PawnGenerator.DoGenerateNewNakedPawn (Verse.PawnGenerationRequest&,string&,bool) <0x0026d>
at Verse.PawnGenerator.GenerateNewNakedPawn (Verse.PawnGenerationRequest&) <0x00174>
at (wrapper dynamic-method) Verse.PawnGenerator.GeneratePawn_Patch1 (Verse.PawnGenerationRequest) <0x0025e>
at RimWorld.PawnGroupKindWorker_Trader.GenerateTrader (RimWorld.PawnGroupMakerParms,RimWorld.PawnGroupMaker,RimWorld.TraderKindDef) <0x001d6>
at RimWorld.PawnGroupKindWorker_Trader/<GeneratePawns>c__IteratorC0.MoveNext () <0x0018f>
at RimWorld.PawnGroupMakerUtility/<GeneratePawns>c__IteratorC4.MoveNext () <0x003cb>
at System.Collections.Generic.List`1<Verse.Pawn>.AddEnumerable (System.Collections.Generic.IEnumerable`1<Verse.Pawn>) <0x00095>
at System.Collections.Generic.List`1<Verse.Pawn>..ctor (System.Collections.Generic.IEnumerable`1<Verse.Pawn>) <0x00089>
at System.Linq.Enumerable.ToList<Verse.Pawn> (System.Collections.Generic.IEnumerable`1<Verse.Pawn>) <0x00040>
at RimWorld.IncidentWorker_NeutralGroup.SpawnPawns (RimWorld.IncidentParms) <0x00098>
at RimWorld.IncidentWorker_TraderCaravanArrival.TryExecute (RimWorld.IncidentParms) <0x000ae>
at RimWorld.Storyteller.TryFire (RimWorld.FiringIncident) <0x00063>
at RimWorld.IncidentQueue.IncidentQueueTick () <0x00066>
at RimWorld.Storyteller.StorytellerTick () <0x0001f>
at Verse.TickManager.DoSingleTick () <0x0033b>

Verse.Log:Error(String)
Verse.TickManager:DoSingleTick()
Verse.TickManager:TickManagerUpdate()
Verse.Game:Update()
Verse.Root_Play:Update()

Spiders Everywhere

Quote from: Linq on April 24, 2017, 08:02:07 PM
Hello,

The error you receive from Hospitality is superficial and can be safely ignored. The ex-lover save corrupting issue has no clear cause and it's been incredibly difficult to find anyone who can help me test it (contrary to Holothurin's experience,  the pawns in my colony absolutely refuse to break up). I have an update in the works but would prefer to ensure that the dynamic relations bug is fixed before releasing it.

Thanks.

What kind of help do you need? I have a save just before one on my colonists forgets her dead fiance, and if I save after it's corrupted. Debug throws this when it happens:

Exception ticking Lewis: System.ArgumentException: Field pawnsWithDirectRelationsWithMe defined on type RimWorld.Pawn_RelationsTracker is not a field on the target object which is of type Psychology.PsychologyPawn.
Parameter name: obj
  at System.Reflection.MonoField.GetValue (System.Object obj) [0x00000] in <filename unknown>:0
  at Psychology.Detour._InteractionWorker_Breakup.AddExLover (Psychology.PsychologyPawn lover, Psychology.PsychologyPawn ex) [0x00000] in <filename unknown>:0
  at Psychology.Detour._InteractionWorker_RomanceAttempt._BreakLoverAndFianceRelations (RimWorld.InteractionWorker_RomanceAttempt _this, Verse.Pawn pawn, System.Collections.Generic.List`1& oldLoversAndFiances) [0x00000] in <filename unknown>:0
  at Psychology.Detour._InteractionWorker_RomanceAttempt._Interacted (RimWorld.InteractionWorker_RomanceAttempt _this, Verse.Pawn initiator, Verse.Pawn recipient, System.Collections.Generic.List`1 extraSentencePacks) [0x00000] in <filename unknown>:0
  at RimWorld.Pawn_InteractionsTracker.TryInteractWith (Verse.Pawn recipient, RimWorld.InteractionDef intDef) [0x00000] in <filename unknown>:0
  at Hospitality.Detouring.Pawn_InteractionsTracker.TryInteractRandomly (RimWorld.Pawn_InteractionsTracker _this) [0x00000] in <filename unknown>:0
  at RimWorld.Pawn_InteractionsTracker.InteractionsTrackerTick () [0x00000] in <filename unknown>:0
  at Verse.Pawn.Tick () [0x00000] in <filename unknown>:0
  at Verse.TickList.Tick () [0x00000] in <filename unknown>:0
Verse.Log:Error(String)
Verse.TickList:Tick()
Verse.TickManager:DoSingleTick()
Verse.TickManager:TickManagerUpdate()
Verse.Game:Update()
Verse.Root_Play:Update()

Kassidoo

I've had 2 colonies Brick the last 24 hours with the breakup bug. I'd love to test the "fix" you have

Praetorian

Same here, I had this mod working fine with hospitality and about a dozen other mods, even with a breakup. Now I'm getting this when I boot up Rimworld:

[HugsLib] Exception during DetourMethodByAttribute: System.Exception: Failed to detour method Pawn_RelationsTracker.Notify_RescuedBy to _Pawn_RelationsTracker._Notify_RescuedBy (assembly: Psychology) ---> System.Exception: method was already detoured to Hospitality.Detouring.Pawn_RelationsTracker.Notify_RescuedBy.
  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()


and this when loading the save:

Exception from asynchronous event: System.NullReferenceException: Object reference not set to an instance of an object
  at RimWorld.Pawn_RelationsTracker.ExposeData () [0x00000] in <filename unknown>:0
  at Verse.PostLoadInitter.DoAllPostLoadInits () [0x00000] in <filename unknown>:0
  at Verse.Game.LoadGame () [0x00000] in <filename unknown>:0
  at Verse.SavedGameLoader.LoadGameFromSaveFile (System.String fileName) [0x00000] in <filename unknown>:0
  at Verse.Root_Play.<Start>m__736 () [0x00000] in <filename unknown>:0
  at Verse.LongEventHandler.RunEventFromAnotherThread (System.Action action) [0x00000] in <filename unknown>:0
Verse.Log:Error(String)
Verse.LongEventHandler:RunEventFromAnotherThread(Action)
Verse.LongEventHandler:<UpdateCurrentAsynchronousEvent>m__733()

System.Linq

I think what I'm going to do is roll back the dynamic relationship def thing to vanilla. I simply don't understand enough about the bug or what causes it, and I don't have the time to figure it out. I'll try and release a new version this weekend.