Sublime Text Setup

Revision as of 03:17, 26 April 2012 by imported>JustinOther (%AppData%\Roaming\ + "Tools" > "Build System" > "Papyrus")

Sublime Text is a new text editor that has a lot of modern features, a pretty cool dev community, and a very slick feel to it. We've made a package for it that makes it a good tool for developing Papyrus scripts.

Loading syntax highlighting and auto-complete

  1. Go to the Sublime Text website and install the latest release of version 2.
  2. Run the program at least once so it will set up its preferences and whatnots.
  3. Copy the Papyrus folder from this zip file to your local drive: %APPDATA%\Sublime Text 2\Packages

Quick Compile

Assuming that your copy of the Papyrus Compiler and its associated batch files are in their default locations and "Tools" > "Build System" > "Papyrus" has been selected, you should be able to hit F7 while looking at a Papyrus file to run it through the compiler. (The output will appear in the bottom panel, so be sure to check for any errors!) If you have any problems, look at %AppData%\Roaming\Sublime Text 2\Packages\Papyrus\Papyrus.sublime-build and make sure the path to your compile batch file is correct.

  • NOTE: By default and after any Creation Kit updates, you'll find the batch file will not work initially as it's pointed to Bethesda's developer directory. To set it up for your Skyrim installation, Right-Click > Edit "Skyrim\Papyrus Compiler\ScriptCompile.bat" and make sure its filepaths are pointed to your Skyrim. One of the below, in its entirety, should work for a default Skyrim installation (Steam folder) on x86 or x64 Windows Vista/7:

For 64-Bit (If you have a "C:\Program Files(x86)" folder)

"%ProgramFiles(x86)%\Steam\SteamApps\Common\Skyrim\Papyrus Compiler\PapyrusCompiler.exe" %1 -f="TESV_Papyrus_Flags.flg" -i="%ProgramFiles(x86)%\Steam\SteamApps\Common\Skyrim\Data\Scripts\Source" -o="%ProgramFiles(x86)%\Steam\SteamApps\Common\Skyrim\Data\Scripts"
Pause

For 32-Bit Win XP, use the below:

"%ProgramFiles%\Steam\SteamApps\Common\Skyrim\Papyrus Compiler\PapyrusCompiler.exe" %1 -f="TESV_Papyrus_Flags.flg" -i="%ProgramFiles%\Steam\SteamApps\Common\Skyrim\Data\Scripts\Source" -o="%ProgramFiles%\Steam\SteamApps\Common\Skyrim\Data\Scripts"
Pause

Updating the snippets

The existing Papyrus package for Sublime Text includes a number of snippets that will auto-complete to frequently used things (like typing "onhit" and then tab will create a proper OnHit event so you don't have to constantly be looking up the syntax). If you want to make more of these, you can simply add another .sublime-snippet file to the Package directory. Documentation on snippets is available at Sublime Text docs site.