Difference between revisions of "Modding Tutorials/Setting up a solution"
Jump to navigation
Jump to search
(→Setting up a solution: Note on the method being different for other IDEs) |
|||
Line 6: | Line 6: | ||
=Requirements= | =Requirements= | ||
− | * This tutorial requires you to have [[Modding_Tutorials/Mod_folder_structure#The Source and Assemblies folders|set up a Source and Assemblies folder]].<br/><br/> | + | * This tutorial requires you to have [[Modding_Tutorials/Mod_folder_structure#The Source and Assemblies folders|set up a Source and Assemblies folder]]. |
+ | * You will want to have an IDE installed: [[Modding Tutorials/Recommended software#IDE's|Recommended IDE's]].<br/><br/> | ||
=Setting up a solution= | =Setting up a solution= |
Revision as of 21:48, 9 November 2015
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
- This tutorial requires you to have set up a Source and Assemblies folder.
- You will want to have an IDE installed: Recommended IDE's.
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
- Create a new class library project in your IDE of choice;
- Go to File -> New -> Solution;
- Go to C# or .NET -> Library or Class Library (NOT portable);
- Enter a project name (solution name automatically updated);
- Choose a location, preferably:
(RimWorldInstallFolder)/Mods/(YourModName)/Source
- 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:
- Copy these files:
(RimWorldInstallFolder)/RimWorld_Data/Managed/Assembly-CSharp.dll (RimWorldInstallFolder)/RimWorld_Data/Managed/UnityEngine.dll
- Place them in your project:
(RimWorldInstallFolder)/Mods/(YourModName)/Source/(YourSolutionName)/Source-DLLs
- 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 both DLLs and click OK,
- Copy these files:
- 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)";
- Choose Properties;
- Go to the "Compiling" tab, "Output", "Target framework", "Change" and choose ".NET Framework 3.5",
- In your project properties, change the build events so only a single file is built:
- 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,
- In your project properties, fix the output location to put the DLL in the Assemblies folder:
- Change the output path to "..\..\Assemblies\".
- Change the output path to "..\..\Assemblies\".
See also
- Writing custom code continues on setting up your solution.