Editing Modding Tutorials/Setting up a solution
Jump to navigation
Jump to search
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision | Your text | ||
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]]. |
* You will want to have an IDE installed: [[Modding Tutorials/Recommended software#IDE's|Recommended IDE's]].<br/><br/> | * You will want to have an IDE installed: [[Modding Tutorials/Recommended software#IDE's|Recommended IDE's]].<br/><br/> | ||
Line 12: | Line 12: | ||
Setting up can be different for different IDE's. Feel free to add '''''complete''''' instructions for your IDE of choice. | Setting up can be different for different IDE's. Feel free to add '''''complete''''' instructions for your IDE of choice. | ||
− | ===Visual Studio Community | + | ===Visual Studio Community 2017=== |
− | ''NOTE: Visual Studio | + | ''NOTE: Visual Studio 2017 is a rather heavy application (2-3 GB for basic functionality) but has a bit more functionality. Only Install if your computer can handle it! The tutorial is similar for Visual Studio 2015.'' |
− | |||
− | |||
− | |||
# Create a new class library project | # Create a new class library project | ||
## Once loaded, go to File -> New -> Project... | ## Once loaded, go to File -> New -> Project... | ||
− | ## | + | ## Go to Templates -> Visual C# -> Class Library (.NET Framework if applicable) |
− | ## Enter your | + | ## Enter your name and solution name in the lower pane. |
## Choose a location, preferably:<br/><pre>(RimWorldInstallFolder)/Mods/(YourModName)/Source</pre> | ## Choose a location, preferably:<br/><pre>(RimWorldInstallFolder)/Mods/(YourModName)/Source</pre> | ||
− | ## | + | ## ''Optional'': Untick "Create directory for solution" |
− | + | # In your project, set target framework and various other porperties | |
− | # In your project, set target framework and various other | + | ## In your Solution Explorer, right click your project -> Properties |
− | ## In your Solution Explorer | + | ## Once in your properties, select Application -> Set Target Framework to .NET Framework 3.5 (No client profile) |
− | ## ''Optional'': | + | ## ''Optional'': Change your Assembly and Namespace names to anything of your choice |
− | ## Go to Build -> Advanced... and set | + | ## Go to Build -> Advanced... -> Debugging information and set it to none |
− | ## Leave Advanced..., and set the Output Path to "..\..\Assemblies\" ( | + | ## Leave Advanced..., and set the Output Path to "..\..\Assemblies\" (The Assemblies folder in your mod folder) |
# Add references to RimWorld code | # Add references to RimWorld code | ||
− | ## Expand your project | + | ## Expand your project. Then right click "References" -> Add Reference... |
## Click Browse... | ## Click Browse... | ||
− | ## Navigate towards <pre> | + | ## Navigate towards <pre>RimWorld******/RimWorld******_Data/Managed</pre> and select files: <br/><pre>Assembly-CSharp.dll UnityEngine.dll</pre> |
## Click "Add" | ## Click "Add" | ||
− | + | ## Right click on both Assembly-CSharp.dll and UnityEngine.dll and set Copy Local to False (Properties pane). | |
− | ## Right | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
===Sharpdevelop=== | ===Sharpdevelop=== | ||
− | |||
− | |||
# Create a new class library project in your [[Modding Tutorials/Recommended software#IDE.27s|IDE of choice]]; | # Create a new class library project in your [[Modding Tutorials/Recommended software#IDE.27s|IDE of choice]]; | ||
## Go to File -> New -> Solution; | ## Go to File -> New -> Solution; | ||
Line 92: | Line 43: | ||
## 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..."; | ## Choose the ".NET Assembly Browser" tab and "Browse..."; | ||
− | ## Navigate towards <pre>RimWorld******/RimWorld******_Data/Managed</pre> and select files: <br/><pre>Assembly-CSharp.dll UnityEngine | + | ## Navigate towards <pre>RimWorld******/RimWorld******_Data/Managed</pre> and select files: <br/><pre>Assembly-CSharp.dll UnityEngine.dll</pre> |
## Click "Open" then "OK"; | ## 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 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 | + | # In your project properties, change the target framework to .NET 3.5: |
## In your IDE project file browser, right-click "(YourSolutionName)"; | ## In your IDE project file browser, right-click "(YourSolutionName)"; | ||
## Choose Properties; | ## Choose Properties; | ||
− | ## Go to the "Compiling" tab, "Output", "Target framework", "Change" and choose ".NET Framework | + | ## 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: | # In your project properties, change the build events so only a single file is built: | ||
## Go to the "Compiling" tab, "Output", "Debug info" and choose "No debug information"; | ## Go to the "Compiling" tab, "Output", "Debug info" and choose "No debug information"; | ||
Line 105: | Line 56: | ||
## Go to the "Compiling" tab, "Output", "Output path" and change the output path to "..\..\Assemblies\".<br/><br/> | ## Go to the "Compiling" tab, "Output", "Output path" and change the output path to "..\..\Assemblies\".<br/><br/> | ||
− | ===Xamarin | + | ===Xamarin=== |
The setup is similar as the one above. A few special points to address: | The setup is similar as the one above. A few special points to address: | ||
− | # Mono 4.X isn't backward compatible so you may need to install an older 3.X version of Mono in order to compile against . | + | # Mono 4.X isn't backward compatible so you may need to install an older 3.X version of Mono in order to compile against .NET3.5 dlls. |
− | # Make sure you uncheck "Use MSBuild build engine (recommended for this project type)" under project > options > build > general | + | # Make sure you uncheck "Use MSBuild build engine (recommended for this project type)" under project > options > build > general |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
=See also= | =See also= |