RimWorld
Psychology (unofficial) v1.1-1.6
Winter 2020년 3월 8일 오전 12시 21분
Androids compatibility
Just in case you'd be interesting in smoothing out the interaction between Psychology and the android mods, here's a couple of changes I made to my local copy a year or so ago:

In PsychologyBase.cs, in the DefsLoaded function around line 237, setting it to

IEnumerable<ThingDef> things = ( from def in DefDatabase<ThingDef>.AllDefs where def.race?.intelligence == Intelligence.Humanlike && !def.defName.Contains("AIPawn") && !def.defName.Contains("ChjDroid") && !def.defName.Contains("ChjBattleDroid") && !def.defName.Contains("Robot") && (zombieThinkTree == null || def.race.thinkTreeMain != zombieThinkTree) select def );

prevents the psyche tab from being added to ChJees worker droids and battle droids, while still allowing ChJees androids and Tiers androids (all of which are social pawns) to have a psyche tab.

In the main\Conversations\Rendezvous folder, in LordJob_HangOut.cs, in the ShouldBeCalledOff function around line 70, setting it to

return !PartyUtility.AcceptableGameConditionsToContinueParty(base.Map) || this.initiator.GetTimeAssignment() == TimeAssignmentDefOf.Work || this.recipient.GetTimeAssignment() == TimeAssignmentDefOf.Work || (this.initiator.needs.rest != null && this.initiator.needs.rest.CurLevel < 0.3f) || (this.recipient.needs.rest != null && this.recipient.needs.rest.CurLevel < 0.3f);

adds a check to see if a rest need exists, before seeing if the rest need is low; this prevents a situation where hanging out never ends.
< >
전체 댓글 8개 중 1~8개 표시 중
che_lovek  [개발자] 2020년 3월 9일 오전 8시 43분 
I added compatability for Androids and removed Psyche tab from Droids and Battle droids as you suggested. However, I am still unable to recreate that unending hangout bug. The code you provided is quite similar to what is alredy there.
Winter 2020년 3월 9일 오후 12시 04분 
Thanks for your work.

The version of the hangout bug I had run into only occurred when one of the participants was a Tiers android, which might not happen during the lifespan of the average colony. The only change I made was to check to see if the rest need exists (needs.rest != null) before reading the rest level, which seemed to clear it up. It's probably fine without the change.
Winter 2020년 3월 9일 오후 1시 03분 
And of course, less than an hour after I said that, one of my Tiers androids asked someone to hang out with him, leading to the debug log saying:

Exception while ticking lord with job Psychology.LordJob_HangOut:
System.NullReferenceException: Object reference not set to an instance of an object
at Psychology.LordJob_HangOut.ShouldBeCalledOff () [0x00032] in <c5a07323ccb84d2882a72e1c3fe7a96e>:0

once per tick.

A little anesthetic put a stop to it, but maybe it would be good to have the "needs.rest != null" check in there.
crazykid080 2020년 3월 9일 오후 8시 35분 
Yeah, having this bug too, apparently I had a 12 GB log file due to the errors
che_lovek  [개발자] 2020년 3월 10일 오후 1시 31분 
Should be fixed now.
Winter 2020년 3월 10일 오후 3시 05분 
Looks good. Just started up a test colony, spawned a dozen androids, ran it for a couple of days, and had two hang-outs run start and end successfully.
che_lovek  [개발자] 2020년 3월 10일 오후 3시 11분 
Happy to hear! Also, thanks for pointing out what to fix.
crazykid080 2020년 3월 10일 오후 3시 13분 
Yep, looks like the errors are gone too! Thanks for taking the time to fix it! Much appreciated
< >
전체 댓글 8개 중 1~8개 표시 중
페이지당 표시 개수: 1530 50