Development environment setup
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.
Prerequisites
Environment
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 theclasslib
template.Validate if all project files were generated within your project's directory.
Open the
MyPuckMod.csproj
file and remove theImplicitUsings
andNullable
tags, since those features are not available in .NET 4.8. Speaking of .NET 4.8, replace the contents ofTargetFramework
tonet4.8
, since we'll be targeting that particular .NET Framework version. YourMyPuckMod.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
We're set up!
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!
Last updated