Hey everybody
Im trying to make a furniture which gives thoughts to pawns around and Im horribly failing. I tried a few approaches but none worked.
1st I tried to hijack the ThoughtGiver with public Thought GiveObservedThought() - I copied it from the Gibbet_Cage AND from the Corpse class but none of them seem to work for me.
2nd I tried to add thoughts via pawn.psychology.thoughts.TryGainThought() - works fine for other classes but doesnt do anything at all in my building also I cant find any override like: Observed() or something.
3rd I tried to implement it in my global observer class and defined IntVec3s via GenRadial.RadialCellsAround() but I couldnt find a (memory saving) way to get Pawns in those IntVec3s or the cells within the IntVec3s.
4th I tried <InspectedDirectThought> out of desperation. Guess what happened.. Nothing.
Share your thoughts. Maybe Im just stupid and dont see the solution.
I was wondering if any headway was made on this issue. I'm was thinking of doing something like this myself. Obviously it is doable in alpha 8 so my project might wait until then, but if it is possible now (on A7) without any .dll work then I might get started on it.
(http://static.tvtropes.org/pmwiki/pub/images/MTG-ThreadNecromancer_3198.jpg)
should I take that as a no?
You definitely need .dll... ;)
Here is a simplified example from M&Co. Security enforcement:
IEnumerable<Pawn> colonistList = Find.ListerPawns.FreeColonists;
foreach (Pawn colonist in colonistList)
{
if (colonist.Position.WithinHorizontalDistanceOf(this.Position, maxRange)
&& (this.GetRoom() == colonist.GetRoom()))
{
colonist.psychology.thoughts.TryGainThought(new Thought(ThoughtDef.Named("ThoughtDefName")));
}
}