Get setup for working on scripts and scripting events for TES V: Skyrim and Fallout 4 by Bethesda Game Studios using Creation Kit and Notepad++. For scripting the Creation Kit uses “Papyrus” scripting system, and you’ll need to setup for working with the “Papyrus Compiler.” Instead of working on scripts within the Creation Kit, you may find it preferable to work an external editor like Notepad++. Sublime and Visual Studio Code also support “Papyrus” syntax highlighting. Many scripts for Skyrim may also work for Fallout 4. Review the differences on this Creation Kit wiki article.

Resources:

Familiarity with using the command prompt, archive utilities, batch files, and some scripting or programming experience is assumed. The following example is for Skyrim.

Source files and compiler setup

You’ll need the game’s Papyrus source files (extension psc) and the “Papyrus Compiler” found with Creation Kit. (And the game, of course.) You may want to backup your game’s data files in case something gets overwritten, or a mod plugin stops working correctly.

If you haven’t yet, install Creation Kit which can be found in Steam by selecting Library and Tools in the drop-down. Find “Skyrim Creation Kit” and install. In the instructions below, if you need help finding your game folder, in Steam right-click the game, select properties, view “Local Files” tab and click “Browse Local Files” button.

Script source files

The Papyrus source psc files are found in skyrim\Data\scripts\source folder. Before continuing, backup any existing source files. I also keep a clean copy of my entire Skyrim data with favorite mods on another drive for safe keeping.

Most of the source files are inside an archive, Scripts.rar found in skyrim\Data folder. If it is not there, you may need to go in Steam and refresh Skyrim Creation Kit (properties -> Local Files -> verify …).

Extract the source files from Scripts.rar into ..\skyrim\Data\scripts\source folder.

Update the compiler batch file

The compiler and batch files are located in ..\skyrim\Papyrus Compiler\ folder. Edit the ScriptCompile.bat file with correct pathing for your system, for the executable, for sources (-i), and output (-o) directories. The output folder is just one above the source. Here is an example for my system:

ScriptCompile.bat
"C:\Program Files (x86)\Steam\steamapps\common\skyrim\Papyrus Compiler\PapyrusCompiler.exe" %1 -f="TESV_Papyrus_Flags.flg" -i="C:\Program Files (x86)\Steam\steamapps\common\skyrim\Data\scripts\source" -o="C:\Program Files (x86)\Steam\steamapps\common\skyrim\Data\scripts"
pause

Test compile

Try the following simple script to ensure everything is setup correctly.

HelloWorldScript.psc
Scriptname HelloWorldScript extends ObjectReference
{My first script!}
Event OnActivate(ObjectReference akActionRef)
Debug.MessageBox("Hello, World?")
endEvent

External editor setup

Notepad++

Besides editing script files, you may also launch the compiler directly from Notepad++. Very handy. For details on setting up with syntax highlighting, see www.creationkit.com/index.php?title=Notepad%2B%2B_Setup for details. I’ll go over just the basics here.

To launch compiler from Notepad++, add a new run-shortcut menu item.

  1. Start Notepad++.
  2. Select Run (F5).
  3. Paste the command below, updated with correct path for your system, into the box and save:
Run-shortcut
"C:\Program Files (x86)\Steam\steamapps\common\skyrim\Papyrus Compiler\ScriptCompile.bat" "$(FILE_NAME)" "$(CURRENT_DIRECTORY)"

For syntax highlighting, copy-paste the XML contents from the Notepad++ Setup article into a file and import under Language -> Define Your Language.

Load the test script above to ensure everything is working.

CkScriptNotepadpp

Visual Studio Code

VS Code works on Windows, OS X, or Linux with syntax highlighting for many languages and debug options for some.

  1. Install VS Code if needed.
  2. Launch VS Code.
  3. Press F1 and in the box type, “ext install papyrus” which reveals a list.
  4. Select a Papyrus extension (v0.0.1 by Andrew at this time of writing).

CkScriptVSCode