Skip to main content

Deadworks Scripting API Documentation

Deadworks is a .NET plugin framework for creating server-side mods for Deadlock (Valve's Source 2 game). Plugins are compiled as .NET DLLs and loaded at runtime, with full access to the game's entity system, networking, damage pipeline, and more.

Quick Start

  • Project Setup — Create a Visual Studio project, reference the API DLL, and configure auto-deploy
  • Your First Plugin — Build a minimal plugin with a chat command

API Reference

TopicDescription
Plugin BaseDeadworksPluginBase, lifecycle hooks, IDeadworksPlugin interface
Chat Commands[ChatCommand] attribute, ChatCommandContext
Console Commands & ConVars[ConCommand], [ConVar], ConVar class
TimersTimer.Once, Timer.Every, Timer.Sequence, Duration
EntitiesCBaseEntity, entity creation, schema access, EntityData<T>
PlayersCCitadelPlayerController, CCitadelPlayerPawn, Players helpers
NetworkingNetMessages.Send, RecipientFilter, message hooks
ParticlesCParticleSystem, fluent builder API
ModifiersAddModifier, KeyValues3, EModifierState
DamageOnTakeDamage, CTakeDamageInfo, Hurt()
Game Events[GameEventHandler], GameEvents, GameEvent
Entity I/OEntityIO.HookOutput, EntityIO.HookInput
ConfigurationIPluginConfig<T>, BasePluginConfig, JSON serialization
HeroesHeroes enum, HeroTypeExtensions, CitadelHeroData
PrecachingPrecache.AddResource, Precache.AddHero
TracingTrace.Ray, TraceShape, CGameTrace, collision filtering
World TextCPointWorldText, ScreenText

Guides

Example Plugins

Full annotated breakdowns of real plugins:

  • Roll The Dice — Random effects via chat command (particles, modifiers, timers)
  • Item Rotation — Timed item set rotation with JSON config
  • Deathmatch — Full game mode: spawn control, team balancing, custom commands
  • Scourge — Damage-over-time effect using OnTakeDamage + timer sequences

Architecture

Your Plugin (.cs)

├── inherits DeadworksPluginBase
├── references DeadworksManaged.Api.dll
└── compiles to .NET DLL

└── deployed to: Deadlock/game/bin/win64/managed/plugins/

Runtime: .NET 10.0 Dependencies: DeadworksManaged.Api.dll, Google.Protobuf.dll Namespace: DeadworksManaged.Api