Difference between revisions of "Modding Tutorials/Setting up a solution"

From RimWorld Wiki
Jump to navigation Jump to search
(→‎Sharpdevelop: Updated to not include the Source-DLLs folder)
Line 20: Line 20:
 
## ''Optional'': Untick "Create a directory for solution"/"Create a project within the solution directory",
 
## ''Optional'': Untick "Create a directory for solution"/"Create a project within the solution directory",
 
# In your project, add references to Assembly-CSharp.dll and UnityEngine.dll:
 
# In your project, add references to Assembly-CSharp.dll and UnityEngine.dll:
## Copy these files:<br/><pre>(RimWorldInstallFolder)/RimWorld_Data/Managed/Assembly-CSharp.dll&#10;(RimWorldInstallFolder)/RimWorld_Data/Managed/UnityEngine.dll</pre>
 
## Place them in your project:<br/><pre>(RimWorldInstallFolder)/Mods/(YourModName)/Source/(YourSolutionName)/Source-DLLs</pre>
 
 
## In your IDE project file browser, right-click the "References" folder and "Add reference";
 
## In your IDE project file browser, right-click the "References" folder and "Add reference";
## Choose the ".NET Assembly Browser" tab and "Browse", go to the folder you placed the copied DLLs;
+
## Choose the ".NET Assembly Browser" tab and "Browse...";
## Choose both DLLs and click OK,
+
## Navigate towards <pre>RimWorld******/RimWorld******_Data/Managed</pre> and select files: <br/><pre>Assembly-CSharp.dll&#10;UnityEngine.dll</pre>
 +
## Click "Open" then "OK";
 +
## In the References folder, right-click Assembly-CSharp -> Properties and change "Local copy" to False. Do the same for UnityEngine,
 
# In your project properties, change the target framework to .NET 3.5:
 
# In your project properties, change the target framework to .NET 3.5:
 
## In your IDE project file browser, right-click "Solution (YourSolutionName)" or just "(YourSolutionName)";
 
## In your IDE project file browser, right-click "Solution (YourSolutionName)" or just "(YourSolutionName)";
Line 31: Line 31:
 
# In your project properties, change the build events so only a single file is built:
 
# In your project properties, change the build events so only a single file is built:
 
## Change the debug info to "No debug information";
 
## Change the debug info to "No debug information";
## In the References folder, right-click Assembly-CSharp -> Properties and change "Local copy" to False. Do the same for UnityEngine;
 
 
## Right-click your .cs files -> Properties and change "Copy to out" to Never,
 
## Right-click your .cs files -> Properties and change "Copy to out" to Never,
 
# In your project properties, fix the output location to put the DLL in the Assemblies folder:
 
# In your project properties, fix the output location to put the DLL in the Assemblies folder:

Revision as of 11:02, 9 April 2016

Modding Tutorials

This page was originally created by Alistaire.

In this tutorial you will learn how to set up a solution, along with instructions on setting the output directory and files for more convenient building right into the Assemblies folder.

Requirements

Setting up a solution

Setting up can be different for different IDE's. Feel free to add complete instructions for your IDE of choice.

Sharpdevelop

  1. Create a new class library project in your IDE of choice;
    1. Go to File -> New -> Solution;
    2. Go to C# or .NET -> Library or Class Library (NOT portable);
    3. Enter a project name (solution name automatically updated);
    4. Choose a location, preferably:
      (RimWorldInstallFolder)/Mods/(YourModName)/Source
    5. Optional: Untick "Create a directory for solution"/"Create a project within the solution directory",
  2. In your project, add references to Assembly-CSharp.dll and UnityEngine.dll:
    1. In your IDE project file browser, right-click the "References" folder and "Add reference";
    2. Choose the ".NET Assembly Browser" tab and "Browse...";
    3. Navigate towards
      RimWorld******/RimWorld******_Data/Managed
      and select files:
      Assembly-CSharp.dll
      UnityEngine.dll
    4. Click "Open" then "OK";
    5. In the References folder, right-click Assembly-CSharp -> Properties and change "Local copy" to False. Do the same for UnityEngine,
  3. In your project properties, change the target framework to .NET 3.5:
    1. In your IDE project file browser, right-click "Solution (YourSolutionName)" or just "(YourSolutionName)";
    2. Choose Properties;
    3. Go to the "Compiling" tab, "Output", "Target framework", "Change" and choose ".NET Framework 3.5",
  4. In your project properties, change the build events so only a single file is built:
    1. Change the debug info to "No debug information";
    2. Right-click your .cs files -> Properties and change "Copy to out" to Never,
  5. In your project properties, fix the output location to put the DLL in the Assemblies folder:
    1. Change the output path to "..\..\Assemblies\".

See also