🏒
Puck
  • Welcome!
  • GETTING STARTED
    • Development environment setup
    • Using the Puck API
    • Testing your mod
    • Development optimizations
  • PUBLISHING
    • SteamWorkshopUploader
    • Publishing to the Steam Workshop
  • Puck API
    • Singletons
    • Harmony
    • Referencing the source
Powered by GitBook
On this page
  1. GETTING STARTED

Testing your mod

PreviousUsing the Puck APINextDevelopment optimizations

Last updated 10 days ago

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.

  1. Navigate to your Puck installation directory and look for a Plugins folder. Make sure that the game has been run at least once, since the folder structure is generated internally from the Puck executable.

  2. Create a new sub-directory within Plugins and name it whatever you wish your mod to be called. In this case, we'll create a folder called MyPuckMod. The resulting absolute path of this directory is as follows: C:\Program Files (x86)\Steam\steamapps\common\Puck\Plugins\MyPuckMod.

  3. Now let's move our built MyPuckMod.dll (bin\Debug\net4.8\MyPuckMod.dll) to the directory we created in the previous step.

  4. 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).

  5. 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.

  6. Open the Puck.log file within the Logs (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.