User:Nosoop/Guide/Development Environments

From AlliedModders Wiki
< User:Nosoop/Guide
Revision as of 22:39, 21 November 2022 by Nosoop (talk | contribs) (Visual Studio Code)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Below are a number of editors suitable for editing SourceMod plugins in.

This page covers basic configuration and usage of each development environment. Configuration may involve third-party addons / extensions to the specific editor; such external packages are linked as options and are not endorsements over any other existing ones.

The environments are ordered alphabetically.

BasicPawn

BasicPawn is a Windows, Visual Basic .NET-based SourcePawn editor written by Timocop. There are reports that suggest it runs on Linux via Wine with .NET Framework 3.5.

Compiling Plugins

TODO figure out how the compiler is installed and provide instructions on how to compile plugin

Notepad++

Notepad++ is a free and open source Windows code editor that uses the Scintilla editor component.

Compiling Plugins

Install NppExec through the Plugins → Plugins Admin menu option, and restart.

Navigate to Plugins → NppExec → Execute... or use F6, and copy the following code into the "Command(s)" text entry:

cd "$(CURRENT_DIRECTORY)"
"C:\spcomp\spcomp.exe" "$(FILE_NAME)" -i"include/" -v0

Replace "C:\spcomp\spcomp.exe" with the location to spcomp.exe on your system, then save it.

F6 will re-open the dialog. Press on "OK" to compile the plugin. CTRL + F6 will execute the last run script, skipping the dialog.

The console will output the results of the compile without the header dialog (only warnings, errors, or successful compile message containing byte sizes). It will generate an .smx file with the same name as the plugin in the same directory.

Syntax Highlighting

  1. Download npp_docs_*.zip from raziEiL/SourceMod-Npp-Docs.
  2. Extract sourcemod.xml and move it into the notepad++\plugins\APIs\ directory.
  3. Navigate to Language → Define your language... and open userDefineLang.xml. (TODO: Is this right?)

SPEdit / SPCode

SPEdit is a Windows, C#-based SourcePawn editor written by _AeonOne_.

SPCode is a maintained fork of SPEdit.

Spider

Spider is a web-based SourcePawn (and AMX Mod X) editor and compiler written by asherkin. It has a simple, one-file interface.

It's perfect for beginners that aren't invested enough into installing and configuring the entire toolchain on their local system. Once you get to working on multiple files or larger projects, you'll want to use a less ephemeral setup.

As of this writing, the spcomp built into Spider is at SourceMod 1.10 support; a number of newer language features may not be available yet.

Compiling Plugins

Click on the "Compile" button in the sidebar at the right. If you only see a gray rectangle with a left-facing triangle, click on that to open the sidebar.

The textbox above the button will show the compiler log output.

On a successful compile, you can click "Download" to save the compiled plugin to your system. The green "play" button allows you to run plugins that use a very limited subset of natives without a game.

Sublime Text

Sublime Text is a shareware, cross-platform code editor.

Syntax Highlighting

The following package is intended for use with Sublime Text 3:

  1. Download the files in NiagaraDryGuy/SourcePawn-Syntax-Highlighting by clicking on the green "Clone or download" button above the file listing.
  2. Install them in your Sublime Text user packages directory.

Completions

The following package is intended for use with Sublime Text 4:

  1. Refer to the installation instructions for JoinedSenses/sourcepawn_sublime_stuff. You may manually download the package or install it via package control.

Visual Studio Code

Visual Studio Code is a free and open source cross-platform code editor developed by Microsoft. However, the official installation does include non-free components; VSCodium is a third-party release without Microsoft's proprietary customizations.

Sarrus's SourcePawn extension provides an extensive list of features for SourceMod development, including SourcePawn highlighting and autocompletion.