Difference between revisions of "Sublime Text Setup"

From the CreationKit Wiki
Jump to navigation Jump to search
imported>JustinOther
m (→‎Quick Compile: F7 or Ctrl+B.)
imported>MrJack
m (Updated the archived version of SublimePapyrus and details regarding the file)
 
(11 intermediate revisions by 5 users not shown)
Line 4: Line 4:
#Go to [http://www.sublimetext.com/2 the Sublime Text website] and install the latest release of version 2.
#Go to [http://www.sublimetext.com/2 the Sublime Text website] and install the latest release of version 2.
#Run the program at least once so it will set up its preferences and whatnots.
#Run the program at least once so it will set up its preferences and whatnots.
#Copy the Papyrus folder from [[Media:Papyrus.zip|this zip file]] to your local drive: <code>%AppData%\Roaming\Sublime Text 2\Packages</code>
#Copy the Papyrus folder from [[Media:Papyrus.zip|this zip file]] to your local drive: <code>%AppData%\Sublime Text 2\Packages</code> or <code>\Sublime Text 2\Data\Packages</code>, if the portable version of Sublime Text 2 is used.
#Optionally, update the Papyrus.tmLanguage file included with the above .zip using [http://pastebin.com/5Kyh3h9w this pastebin]. It includes Skyrim Script Extender functions and will be kept up to date as more functions become available.
#If you have Skyrim installed somewhere outside of <code>C:\Program Files\Steam\steamapps\common\</code> or <code>C:\Program Files (x86)\Steam\steamapps\common\</code>, then you need to set the correct paths in SublimePapyrus.ini, which can be created by running the command "Papyrus INI: Create default INI file" in Sublime Text's Command Palette (CTRL+SHIFT+P).
 
<blockquote>[https://github.com/Kapiainen/SublimePapyrus SublimePapyrus] is an updated version, which also supports Sublime Text 3, of the package linked above. An archived version can be downloaded [http://www.creationkit.com/images/4/42/SublimePapyrus.zip here]
(updated December 18, 2014), if the GitHub repository is inaccessible. SublimePapyrus includes snippets for Skyrim (1.9.32.0.8), SKSE (1.7.1), SkyUI SDK (4.1), FISS (1.21), NetImmerse Override (2.9.6), DienesTools (1.0), JContainers (3.1.1), PapyrusUtil (2.8), and SkyUILib (1).</blockquote>


==Quick Compile==
==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 or Ctrl+B 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 <code>%AppData%\Roaming\Sublime Text 2\Packages\Papyrus\Papyrus.sublime-build</code> and make sure the path to your compile batch file is correct.
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 or Ctrl+B 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!)


*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)
<div style="overflow-x: scroll;"><source lang="xml">"%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</source></div>
For 32-Bit Win XP, use the below:<div style="overflow-x: scroll;"><source lang="xml">"%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</source></div>
*See [[Papyrus_Compiler_Reference|Papyrus Compiler Reference]] for more information.
*See [[Papyrus_Compiler_Reference|Papyrus Compiler Reference]] for more information.


Line 21: Line 18:
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 [http://www.sublimetext.com/docs/2/ Sublime Text docs site].
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 [http://www.sublimetext.com/docs/2/ Sublime Text docs site].
*[[Media:Papyrus Event Snippets.zip|Papyrus Event Snippets]].
*[[Media:Papyrus Event Snippets.zip|Papyrus Event Snippets]].
==Viewing Papyrus Assembly==
If you're interested in viewing Papyrus assembly files (the midway point between source and compiled scripts, file extension .pas), a package is available that provides syntax highlighting and a build system for the Papyrus assembly language.
This package is currently available on Skyrim Nexus - [http://skyrim.nexusmods.com/mods/24009 Papyrus Assembly package for Sublime Text 2]
{{Languages}}
[[Category:Scripting]]
[[Category:Scripting]]
[[Category:Text Editors]]
[[Category:Text Editors]]

Latest revision as of 11:22, 18 December 2014

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[edit | edit source]

  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 or \Sublime Text 2\Data\Packages, if the portable version of Sublime Text 2 is used.
  4. If you have Skyrim installed somewhere outside of C:\Program Files\Steam\steamapps\common\ or C:\Program Files (x86)\Steam\steamapps\common\, then you need to set the correct paths in SublimePapyrus.ini, which can be created by running the command "Papyrus INI: Create default INI file" in Sublime Text's Command Palette (CTRL+SHIFT+P).

SublimePapyrus is an updated version, which also supports Sublime Text 3, of the package linked above. An archived version can be downloaded here (updated December 18, 2014), if the GitHub repository is inaccessible. SublimePapyrus includes snippets for Skyrim (1.9.32.0.8), SKSE (1.7.1), SkyUI SDK (4.1), FISS (1.21), NetImmerse Override (2.9.6), DienesTools (1.0), JContainers (3.1.1), PapyrusUtil (2.8), and SkyUILib (1).

Quick Compile[edit | edit source]

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 or Ctrl+B 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!)

Updating the snippets[edit | edit source]

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.

Viewing Papyrus Assembly[edit | edit source]

If you're interested in viewing Papyrus assembly files (the midway point between source and compiled scripts, file extension .pas), a package is available that provides syntax highlighting and a build system for the Papyrus assembly language.

This package is currently available on Skyrim Nexus - Papyrus Assembly package for Sublime Text 2


Language: English  • français