Difference between revisions of "Modding Tutorials/Decompiling source code"

From RimWorld Wiki
Jump to navigation Jump to search
m
(Made the "Either X or Y" choice in the numbered list more obvious by making them sub items.)
Line 2: Line 2:
  
 
# Download [http://ilspy.net/ ILSpy] (Download Binaries) and extract it to a directory of your choosing. Optionally create a desktop shortcut;
 
# Download [http://ilspy.net/ ILSpy] (Download Binaries) and extract it to a directory of your choosing. Optionally create a desktop shortcut;
# '''Either''': associate the .dll extension with ILSpy (go to 3.) '''or''' open ILSpy and open a .dll (go to 6.);
+
# '''Either''': associate the .dll extension with ILSpy;
# Navigate to ''Assembly-CSharp.dll'' in ''../Rimworld***_Data/Managed/'', relative to your Rimworld installation and with *** being a version number;
+
## Navigate to ''Assembly-CSharp.dll'' in ''../Rimworld***_Data/Managed/'', relative to your Rimworld installation and with *** being a version number;
# Right-click "Open with" and select a standard program. Navigate to your ILSpy installation and double-click ''ILSpy.exe'', tick the checkbox and accept;
+
## Right-click "Open with" and select a standard program. Navigate to your ILSpy installation and double-click ''ILSpy.exe'', tick the checkbox and accept;
# Double-click ''Assembly-CSharp.dll'' (go to 9.);
+
## Double-click ''Assembly-CSharp.dll'',
# Open ILSpy;
+
# '''Or''': open ILSpy and open a .dll;
# Go to File -> Open or press Ctrl+O, navigate to ''../Rimworld***_Data/Managed/'', relative to your Rimworld installation and with *** being a version number;
+
## Open ILSpy;
# Select ''Assembly-CSharp.dll'' and confirm;
+
## Go to File -> Open or press Ctrl+O, navigate to ''../Rimworld***_Data/Managed/'', relative to your Rimworld installation and with *** being a version number;
 +
## Select ''Assembly-CSharp.dll'' and confirm,
 
# Click the "+" next to ''Assembly-CSharp (***)'', you will now see a list including the items ''Rimworld'' and ''Verse'';
 
# Click the "+" next to ''Assembly-CSharp (***)'', you will now see a list including the items ''Rimworld'' and ''Verse'';
 
# Take your time to look through the source code, to make yourself familiar. If you ever need the source code, open ILSpy again.
 
# Take your time to look through the source code, to make yourself familiar. If you ever need the source code, open ILSpy again.

Revision as of 14:34, 11 July 2015

The base game provides a bunch of code snippets in ../Source/, relative to your Rimworld installation. Since this isn't a lot, one might want to take a look at the game's full source code;

  1. Download ILSpy (Download Binaries) and extract it to a directory of your choosing. Optionally create a desktop shortcut;
  2. Either: associate the .dll extension with ILSpy;
    1. Navigate to Assembly-CSharp.dll in ../Rimworld***_Data/Managed/, relative to your Rimworld installation and with *** being a version number;
    2. Right-click "Open with" and select a standard program. Navigate to your ILSpy installation and double-click ILSpy.exe, tick the checkbox and accept;
    3. Double-click Assembly-CSharp.dll,
  3. Or: open ILSpy and open a .dll;
    1. Open ILSpy;
    2. Go to File -> Open or press Ctrl+O, navigate to ../Rimworld***_Data/Managed/, relative to your Rimworld installation and with *** being a version number;
    3. Select Assembly-CSharp.dll and confirm,
  4. Click the "+" next to Assembly-CSharp (***), you will now see a list including the items Rimworld and Verse;
  5. Take your time to look through the source code, to make yourself familiar. If you ever need the source code, open ILSpy again.