Ludeon Forums

RimWorld => Mods => Help => Topic started by: JuliaEllie on September 21, 2014, 01:25:49 AM

Title: some thoughts on thoughts.
Post by: JuliaEllie on September 21, 2014, 01:25:49 AM
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.
Title: Re: some thoughts on thoughts.
Post by: Igabod on December 05, 2014, 02:40:20 PM
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.
Title: Re: some thoughts on thoughts.
Post by: JuliaEllie on December 05, 2014, 03:29:37 PM
(http://static.tvtropes.org/pmwiki/pub/images/MTG-ThreadNecromancer_3198.jpg)
Title: Re: some thoughts on thoughts.
Post by: Igabod on December 05, 2014, 03:35:35 PM
should I take that as a no?
Title: Re: some thoughts on thoughts.
Post by: Rikiki on December 05, 2014, 04:08:04 PM
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")));
                }
            }