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 146: Line 146:
  
 
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: