Help finding the conversation log

Started by nyasara, April 07, 2020, 06:31:43 AM

Previous topic - Next topic

nyasara

I'm just getting started with modding, and initially trying to get a handle on the layout of game data; what's available, what's where, how to get around. One thing I'm having trouble with is finding the "social log" for a pawn. I'd like to be able to inspect/modify/examine the colonist conversations, the basic "Steve talked to Sally about scary clowns". Where can I find this, I've been looking through the `Pawn` class but not finding anything that looks right. Browsing through the decompiled code in dnSpy, but without much of a hint it's hard to pick up a thread that gets me there.

In general, is there documentation on the API? Basic guides on what data is where, how the game state is laid out, etc.?

Thanks all, especially for the devs for supporting modding so well.

K

There isn't one log for each pawn, there's one log for the entire game, which is probably why you weren't finding it searching the Pawn class. The log for the entire game is called the playLog and it can be found in the Game class.

As far as I'm aware there isn't any documentation for the internals of Rimworld. This is probably because they're proprietary and decompiling them is a legal gray area. Since there's no documentation, knowing how the game is laid out internally is fairly important to finding anything in a reasonable amount of time, but since there's no documentation the best way to learn how it's put together is just to decompile it and mod it.

Here's the process i used to find the playLog, since it might help you understand how the game is laid out. I first decompiled the Pawn class and looked at the socialTracker (like you probably did) but that didn't seem to go anywhere. Instead I decided to decompile the ITab_Pawn_Log, which is the code for that tab in the UI. I didn't actually know the name of the particular tab class, but a search for ITab found it quickly. Combing through that I found the ITab_Pawn_Log_Utility which was generating the lines, and in there the playLog was accessed to get the events for the particular pawn.

At least in the UI code of the game, there's a common pattern of a UI class which references a utility class that actually contains most of the code.

nyasara

Awesome, thanks for the answer and the explanation about following the UI, good tip.