Change pawn guilty state

Started by simonster99, October 11, 2021, 10:19:48 AM

Previous topic - Next topic

simonster99

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.

JT

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.