Setting up environment

Unturned Plugin Development #1

MCrow • 3 months ago

Starting with Unturned plugin development you need to set up your development environment. This guide will help you set up Visual Studio and install project templates for creating plugins.

Requirements

This guide assumes you have a basic understanding of C# programming language and experience in hosting Unturned servers. If you are new to C# programming, I recommend you to learn the basics of the language before starting with plugin development. I personally recommend Bob Tabor's C# Fundamentals for Absolute Beginners course on Microsoft Virtual Academy.

Install Visual Studio

Visual Studio is a IDE from Microsoft that is used for developing applications in C# and other languages. It is the recommended IDE for developing Unturned plugins.

  1. Go to visualstudio.microsoft.com and download the latest version of Visual Studio.
  2. Run the installer and follow the instructions.
  3. In the installer, select the following workloads:
    • .NET desktop development
    • Game development with Unity
  4. Open Visual Studio to verify the installation.

Install .NET 8 SDK

.NET SDK contains .NET CLI, which is required to install custom project templates for Unturned plugins.

  1. Go to dotnet.microsoft.com and download the latest .NET SDK.
  2. Run the installer and follow the instructions.
  3. Open terminal or powershell and run dotnet --version to verify the installation. You should see the version of the SDK you installed.

Install Unturned Templates

RestoreMonarchy.UnturnedTemplates are custom project templates I created to simplify the process of creating plugins.

  1. Close Visual Studio if it is open.
  2. Open terminal or powershell and run dotnet new install RestoreMonarchy.UnturnedTemplates
    You should see output similar to the following:
  3. Open Visual Studio and press on Create a new project.
  4. Search for Unturned. You should see the list of Unturned templates.