I want to understand how the game works (and learn modding by the way). However I am not very compatible with usual learning methods such as reading theory and doing tutorials. I need to plunge into a system and attempt to understand it just by looking at it. What I can't understand, I have to ask about. I am going to have lots of questions.
So far I'm using traits as a base to understand game mechanics. Using Masochist trait as an example:
<workerClass>ThoughtWorker_Pain</workerClass> - I can't find where this workerClass comes from. Is it hidden somewhere in C# files? Is there a piece of code that searches for defs with ThoughtWorker_Pain class whenever a pawn is injured, sick or scarred? Where is this file?
So, that piece of code finds the def and a mood effect is triggered with Thoughts_TraitsConditional.xml or Thoughts_ConditionsSpecial.xml. Both of those check for <requiredTraits>, which is a... command (?) coded in C# files searching Traits_Singular.xml and Traits_Spectrum.xml for a specific def name. Is this correct?
you will need a decompiler (ilspy or dotpeek) to look at the classes in the assembly file.
Quote from: skullywag on April 14, 2016, 06:56:29 AM
you will need a decompiler (ilspy or dotpeek) to look at the classes in the assembly file.
Do you mean the Assembly-CSharp.dll file? It seems to be the only file that has understandable game data. I opened it with MonoDevolop (I'm running Linux Mint), but I couldn't find ThoughtWorker_Pain anywhere.
yes I do and Ilspy shows it perfectly fine.
I found it. I guess the 'search in file' tool is not working. But now things become much less intuitive. This is going to keep me busy for a while.
if you just wanna read source, use ilspy, its simple and the search works, you can search for types, members and constants. Its a tiny download. Just point it at the assembly and go.
Quote from: http://rimworldwiki.com/wiki/Modding_Tutorials/Decompiling_source_codeCtrl+Shift+F or Ctrl+E opens the search bar which can be used to search through all loaded assemblies;
I'm probably gonna regret it, but I replaced Linux Mint with Windows 10 just so I can use ILSpy. Hopefully it's find text tool works better than MonoDev's.
You should have just installed a virtual machine instead. That way you wouldn't have had to downgrade to Windows 8/9/10, you could have installed Windows in the VM.
Also, mono develop comes with a decompiler, you didn't even "need" IlSpy. Although, having a GUI and per-class decompiling instead of "DO ALL" is nice.