Project setup
Install Deadworks and set up a Visual Studio project for plugin development.
Prerequisites
- .NET 10.0 SDK or later: download
- Visual Studio or another IDE with .NET support: download
- Deadlock installed via Steam
0. Install Deadlock
You can use your local Deadlock install. To run a server, follow the server instructions instead.
1. Install Deadworks
Download the latest release from https://github.com/Deadworks-net/deadworks/releases and extract it into your Deadlock folder (C:\Program Files (x86)\Steam\steamapps\common\Deadlock).
2. Create a class library project
In Visual Studio, create a new C# Class Library project. The project name can be anything.
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
</Project>
3. Add API references
Add assembly references to the Deadworks API and Google Protobuf DLLs from your Deadlock installation:
<ItemGroup>
<Reference Include="DeadworksManaged.Api">
<HintPath>C:\Program Files (x86)\Steam\steamapps\common\Deadlock\game\bin\win64\managed\DeadworksManaged.Api.dll</HintPath>
</Reference>
<Reference Include="Google.Protobuf">
<HintPath>C:\Program Files (x86)\Steam\steamapps\common\Deadlock\game\bin\win64\managed\Google.Protobuf.dll</HintPath>
</Reference>
</ItemGroup>
If your Steam library is in a different location, change each HintPath to match. The DLLs are also in the managed/ folder of this repository.
4. Configure auto-deploy (optional)
Add a post-build target that copies your compiled plugin to the game's plugin directory:
<Target Name="DeployToGame" AfterTargets="Build">
<ItemGroup>
<DeployFiles Include="$(OutputPath)REPLACE_THIS_WITH_YOUR_PLUGIN_OUTPUT_NAME.dll;$(OutputPath)REPLACE_THIS_WITH_YOUR_PLUGIN_OUTPUT_NAME.pdb" />
</ItemGroup>
<Copy
SourceFiles="@(DeployFiles)"
DestinationFolder="C:\Program Files (x86)\Steam\steamapps\common\Deadlock\game\bin\win64\managed\plugins"
SkipUnchangedFiles="false"
Retries="0"
ContinueOnError="WarnAndContinue" />
</Target>
Replace REPLACE_THIS_WITH_YOUR_PLUGIN_OUTPUT_NAME with the actual file name your plugin project builds, without the .dll or .pdb extension. For example, if your project builds CoolPlugin.dll, the two files are CoolPlugin.dll and CoolPlugin.pdb.
5. Complete .csproj example
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
<RootNamespace>MyPlugin</RootNamespace>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<Reference Include="DeadworksManaged.Api">
<HintPath>C:\Program Files (x86)\Steam\steamapps\common\Deadlock\game\bin\win64\managed\DeadworksManaged.Api.dll</HintPath>
</Reference>
<Reference Include="Google.Protobuf">
<HintPath>C:\Program Files (x86)\Steam\steamapps\common\Deadlock\game\bin\win64\managed\Google.Protobuf.dll</HintPath>
</Reference>
</ItemGroup>
<Target Name="DeployToGame" AfterTargets="Build">
<ItemGroup>
<DeployFiles Include="$(OutputPath)MyPlugin.dll;$(OutputPath)MyPlugin.pdb" />
</ItemGroup>
<Copy
SourceFiles="@(DeployFiles)"
DestinationFolder="C:\Program Files (x86)\Steam\steamapps\common\Deadlock\game\bin\win64\managed\plugins"
SkipUnchangedFiles="false"
Retries="0"
ContinueOnError="WarnAndContinue" />
</Target>
</Project>
Plugin deployment
Deadworks loads compiled plugin DLLs from:
Deadlock/game/bin/win64/managed/plugins/
Copy the full build output to the Deadlock/game/bin/win64/managed/plugins/ folder.
Deadworks loads plugins when the server starts. Editing a plugin DLL while the server is running hot-reloads it.
6. Run Deadworks
Run deadworks.exe from your Deadlock/game/bin/win64/ folder.
Once Deadworks is running, open Deadlock. Connect to your local server from the game console:
connect localhost:27067
Next steps
- Your first plugin: build a minimal working plugin