Testing your mod
Now that we have our environment set up, our dependencies linked and the mod itself built, let's see how we can inject it into the game client and see some interactions.
Navigate to your Puck installation directory and look for a
Pluginsfolder. Make sure that the game has been run at least once, since the folder structure is generated internally from the Puck executable.
Create a new sub-directory within
Pluginsand name it whatever you wish your mod to be called. In this case, we'll create a folder calledMyPuckMod. The resulting absolute path of this directory is as follows:C:\Program Files (x86)\Steam\steamapps\common\Puck\Plugins\MyPuckMod.Now let's move our built
MyPuckMod.dll(bin\Debug\net4.8\MyPuckMod.dll) to the directory we created in the previous step.
Let's launch the game and check the MODS menu. If all is well, your mod should now be visible in the menu along with any other mods you have installed from the Steam Workshop (if any).

Plugins are enabled by default, therefore your mod should already be enabled on startup. Since all our mod does is print a message to the console, let's check the game logs to validate that our mod is in fact working. Close the game client, navigate back to the Puck installation folder and look for a folder called
Logs.Open the
Puck.logfile within theLogs(C:\Program Files (x86)\Steam\steamapps\common\Puck\Logs) folder and look for our message.
Since we're printing to the console every time OnEnabled is called, you can toggle your mod a couple of times and re-check the log output to see the message printed multiple times.
You can open the Puck.log file within Visual Studio Code for a better experience. The log output should update every time the Visual Studio Code window is focused, therefore, you can avoid having to re-open the Puck.log file manually to see any updates.
Congratulations! π You've just created your first mod for Puck. Head over to the next section to see how you can better streamline your development experience allowing you to prototype quicker.
Last updated