Ludeon Forums

RimWorld => Mods => Help => Topic started by: simonster99 on October 11, 2021, 10:19:48 AM

Title: Change pawn guilty state
Post by: simonster99 on October 11, 2021, 10:19:48 AM
Hello, I'm currently stuck and could use some help. I'm trying to change the guilty state of a pawn, I've tried this so far:

this.targetPawn.guilt.lastGuiltyTick = Find.TickManager.TicksGame;

But this only gives an error.
Title: Re: Change pawn guilty state
Post by: JT on October 24, 2021, 10:38:54 AM
guiltyTicksLeft is the only field in Pawn_GuiltTracker, and it's private; not sure where you found lastGuiltyTick, since I can't even find it in ILSpy. =)

What you can do is call pawn.guilt.Notify_Guilty(int) with your own guilt duration, as it simply provides a direct setter for that value.  For instance, this.targetPawn.guilt.Notify_Guilty() would make the pawn guilty for a game day, and Notify_Guilty(12*GenDate.TicksPerHour) would make them guilty for 12 game hours.