-
Notifications
You must be signed in to change notification settings - Fork 13
Developing
Alienmario edited this page Nov 21, 2024
·
11 revisions
- The game's
Dedicated server
installed (directly via Steam or SteamCMD). - Recommended versions of Metamod:Source and SourceMod installed.
- Grab latest build under
master
branch from Github Actions tab. - Extract it in the game root - where gameinfo.txt is located.
- This ensures you get all required files in correct places.
- Game assets are placed under the game root and SourceMod associated files under its root.
- Install VSCode
- Fork SourceCoop and open it as a folder in VSCode
- Optionally add your server as a folder in your workspace
- Install
SourcePawn by Sarrus
extension from the marketplace - Edit the extension settings
- Sourcepawn: Output Directory Path
Example:...\Black Mesa Dedicated Server\bms\addons\sourcemod\plugins/
- Source Pawn Language Server: Include Directories
Example:...\Black Mesa Dedicated Server\bms\addons\sourcemod\scripting\include
- Source Pawn Language Server > Compiler: Path
Example:...\Black Mesa Dedicated Server\bms\addons\sourcemod\scripting\spcomp.exe
- Sourcepawn: Output Directory Path
- Compile
srccoop.sp
- Happy developing!
The game you are compiling for is set via SRCCOOP_* arguments passed to spcomp. The default is SRCCOOP_BLACKMESA
.
- See
scripting\include\srccoop.inc
for how this is setup. - To start with a minimal build, pass
SRCCOOP_CUSTOM_COMPILE=1
. This allows you to cherry pick individual features. A game definition still needs to be passed, as some constants/behavior may differ depending on the game you compiled for. -
NO_DEBUG=1
may be passed to deactivate all debug logging functionality, as is done in release builds.
In VSCode you can edit the compiler arguments in your .code-workspace like so:
{
"settings": {
"SourcePawnLanguageServer.compiler.arguments": [
// "NO_DEBUG=1",
"SRCCOOP_HL2DM=1",
"-O2",
"-v2"
]
}
}
Sourcemod docs: https://wiki.alliedmods.net/Category:SourceMod_Scripting
Sourcemod API reference: https://sm.alliedmods.net/new-api/
Additional resources: https://forums.alliedmods.net/showthread.php?t=321089
Plugin AutoReload: https://forums.alliedmods.net/showthread.php?t=322045