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 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 2022===
+
===Visual Studio Community 2019===
''NOTE: Visual Studio 2022 is a rather heavy application (2-3 GB for basic functionality) but works out of the box. It is strongly recommended if you are on Windows and have a PC that can handle it. This tutorial is similar for other versions of Visual Studio.''
+
''NOTE: Visual Studio 2019 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! This tutorial is similar for other versions of Visual Studio.''
  
  
Line 40: Line 40:
 
This option uses [https://www.nuget.org/packages/Krafs.Rimworld.Ref Krafs Rimworld Reference Package] it is less involved than using reference assemblies and is the recommended method.</br>
 
This option uses [https://www.nuget.org/packages/Krafs.Rimworld.Ref Krafs Rimworld Reference Package] it is less involved than using reference assemblies and is the recommended method.</br>
 
#Follow the above up till ''Add references to RimWorld code''
 
#Follow the above up till ''Add references to RimWorld code''
#From the Tools menu, select NuGet Package Manager -> Package Manager Settings.
 
##In the Settings dialog, under Package Management, change the ''Default package management format'' to '''PackageReference'''.
 
##Click OK to close the dialog.
 
 
#Open Nuget Manager and type ''Rimworld''
 
#Open Nuget Manager and type ''Rimworld''
 
#Add Krafs Rimworld Reference
 
#Add Krafs Rimworld Reference
 +
#When prompted '''Select packagereference''' (this is required for the package to be added)
 
You can now continue as if you added the assemblies
 
You can now continue as if you added the assemblies
 
Doing this makes your project portable, because RimRef can be downloaded by anyone and used from anywhere, unlike Rimworld's assemblies which can't be distributed.
 
Doing this makes your project portable, because RimRef can be downloaded by anyone and used from anywhere, unlike Rimworld's assemblies which can't be distributed.
  
 
====Option 3 (Using Rimworld Dotnet Template):====
 
====Option 3 (Using Rimworld Dotnet Template):====
This option uses [https://github.com/Zeta-of-the-rim/Rimwold-Dotnet-Template Rimworld Dotnet Template] it allows faster creation of mod files including Xml folders</br>
+
This option uses [https://github.com/Burgess12/Rimwold-Dotnet-Template Rimworld Dotnet Template] it allows faster creation of mod files including Xml folders</br>
  
 
After installing the template.
 
After installing the template.
Line 146: Line 144:
  
 
You're done! Note that Rider has a built-in decompiler—to view the source of a RimWorld class or method, just right-click its name and click Go To > Definition.
 
You're done! Note that Rider has a built-in decompiler—to view the source of a RimWorld class or method, just right-click its name and click Go To > Definition.
 
===Visual Studio Code via Dev Container===
 
VS Code provides with Dev Containers a very simple way to set up an working development environment. To make use of Dev Containers you need VS Code with the Dev Containers Extension and docker installed on your machine.
 
 
====Quick Start====
 
For a quick start either clone the repository inside your mods folder:
 
<pre>git clone https://github.com/N3fastus/RainingGoo</pre>
 
or download a zip archive by visiting the [https://github.com/N3fastus/RainingGoo Repository]. Click "Code", then "Download ZIP" and unzip the code in your mods folder.
 
The Mod has a dependency to [https://github.com/pardeike/HarmonyRimWorld/releases Harmony], this one needs also to be in the "Mods" directory. Download the zip and extract it to the "Mods" folder.
 
 
Now open the folder with VS Code. If you are not on Linux you need to adjust the path in '''.devcontainer/docker-compose.yml''' to your platform.
 
To start up the container you need to press '''CTRL + Shift + P''' and type '''"Dev Container: Reopen in Container"'''. This might take a few minutes.
 
When the container is up and running, switch to the terminal inside VS Code and type:
 
<pre>dotnet build</pre>
 
In the Assemblies folder should now be a "RainingGoo.dll".
 
 
====Starting a new Project====
 
To start over with a complete new solution, copy the ".devcontainer" folder to your own project and open it in VS Code.
 
 
To create a new solution file in the actual location:
 
<pre>dotnet new sln</pre>
 
 
To create a new project (here a library) in the actual location:
 
<pre>dotnet new classlib -n MyNewProject -o .</pre>
 
 
To add the created project to the solution file:
 
<pre>dotnet sln add Path/to/MyNewProject.csproj</pre>
 
 
For the configuration of the csproj files compare against the example project above.
 
  
 
=Common issues=
 
=Common issues=

Please note that all contributions to RimWorld Wiki are considered to be released under the CC BY-SA 3.0 (see RimWorld Wiki:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!

Cancel Editing help (opens in new window)

Templates used on this page: