Learning modding by understanding the game

Started by Fafn1r, April 14, 2016, 06:53:35 AM

Previous topic - Next topic

Fafn1r

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?

skullywag

you will need a decompiler (ilspy or dotpeek) to look at the classes in the assembly file.
Skullywag modded to death.
I'd never met an iterator I liked....until Zhentar saved me.
Why Unity5, WHY do you forsake me?

Fafn1r

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.

skullywag

yes I do and Ilspy shows it perfectly fine.
Skullywag modded to death.
I'd never met an iterator I liked....until Zhentar saved me.
Why Unity5, WHY do you forsake me?

Fafn1r

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.

skullywag

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.
Skullywag modded to death.
I'd never met an iterator I liked....until Zhentar saved me.
Why Unity5, WHY do you forsake me?

Alistaire

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;

Fafn1r

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.

1000101

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.
(2*b)||!(2*b) - That is the question.
There are 10 kinds of people in this world - those that understand binary and those that don't.

Powered By