Development environment setup
Last updated
Last updated
In order to get started with Puck development, you will need to set up some sort of development environment on your host system. This document will guide you through setting up a mod development environment in Visual Studio Code, though most steps will also apply to other IDEs.
Create a new folder anywhere on your system which will contain our project files. For the sake of this example, we'll create a folder called MyPuckMod
on the desktop. The absolute path should look as follows: C:\Users\user\Desktop\MyPuckMod
.
Launch Visual Studio Code and open the MyPuckMod
folder within it.
Launch a new terminal window within Visual Studio Code.
Validate your .NET installation by executing a dotnet
command.
Execute a dotnet new classlib
command in order to set up a new .NET project. Since we're creating a Class Library (.dll), we use the classlib
template.
Validate if all project files were generated within your project's directory.
Open the MyPuckMod.csproj
file and remove the ImplicitUsings
and Nullable
tags, since those features are not available in .NET 4.8. Speaking of .NET 4.8, replace the contents of TargetFramework
to net4.8
, since we'll be targeting that particular .NET Framework version.
Your MyPuckMod.csproj
should looks as follows:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net4.8</TargetFramework>
</PropertyGroup>
</Project>
Since we'll be targeting .NET 4.8, features like file-scoped namespaces will also be unavailable, so let's adjust the Class1.cs
file to the following:
namespace MyPuckMod {
public class Class1
{
}
}
Execute the dotnet build
command in the terminal in order to build our project.
Validate the generated .dll of your mod in bin/Debug/net4.8
Awesome! This .dll is essentially our mod, though it does not do anything useful just yet. Not does it interact with the Puck in any way. We'll cover how to do so in the following steps, so stay tuned!