Setup for Script Work with Bethesda's Creation Kit and Notepad++
Article #11 in a 12-part series.
- 1 - Upgrade Skyrim with Mods
- 2 - Skyrim Immersion: Environment
- 3 - Pretty Skyrim: Elements
- 4 - Skyrim Life
- 5 - How to Install Skyrim Body Mods, Dual Sheath, and Animations
- 6 - Pretty Skyrim People
- 7 - Skyrim Gear 1: Clothing
- 8 - Skyrim Gear 2: Akavir
- 9 - Skyrim Gear 3: Light Armor
- 10 - Skyrim Gear 4: Heavy Armor
- 11 - this article
- 12 - Body Conversions for Skyrim Using BodySlide, Outfit Studio
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:
Update for Fallout 4:
This is what I use for the FO4 Papyrus compiler batch file. Replace the drive and folder for your system.
Test compile
Try the following simple script to ensure everything is setup correctly.
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.
- Start Notepad++.
- Select Run (F5).
- Paste the command below, updated with correct path for your system, into the box and save:
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.
Visual Studio Code
VS Code works on Windows, OS X, or Linux with syntax highlighting for many languages and debug options for some.
- Install VS Code if needed.
- Launch VS Code.
- Press F1 and in the box type, “ext install papyrus” which reveals a list.
- Select a Papyrus extension (v0.0.1 by Andrew at this time of writing).
Article #11 in a 12-part series.
- 1 - Upgrade Skyrim with Mods
- 2 - Skyrim Immersion: Environment
- 3 - Pretty Skyrim: Elements
- 4 - Skyrim Life
- 5 - How to Install Skyrim Body Mods, Dual Sheath, and Animations
- 6 - Pretty Skyrim People
- 7 - Skyrim Gear 1: Clothing
- 8 - Skyrim Gear 2: Akavir
- 9 - Skyrim Gear 3: Light Armor
- 10 - Skyrim Gear 4: Heavy Armor
- 11 - this article
- 12 - Body Conversions for Skyrim Using BodySlide, Outfit Studio