===========================================
Papyrus Assembly package for Sublime Text 2
===========================================
:Author: Cipscis (Mark Hanna)
:Contact: mark@cipscis.com
:Version: 1.5
Description
===========
This is a package for Sublime Text 2 that makes it easier to view Papyrus assembly files (file extension ``.pas``). Papyrus is the scripting language used by the video game Skyrim, which can be modified via the `Creation Kit `_. These files can be generated in 2 ways:
- Running the Papyrus compiler with either the ``-keepasm`` or ``-asmonly`` command line arguments. The former compiles the script but keeps the assembly file, whereas the latter does not compile the script and only generates the assembly file.
- Running the Papyrus assembler with the ``-D`` command line argument to disassemble a compiled script (file extension ``.pex``).
Papyrus assembly can be converted into fully compiled Papyrus scripts by running it through the Papyrus assembler. A build system is included in the package to make this easy.
Installation
============
Extract the "Papyrus Assembly" folder into the Packages directory for your Sublime Text 2 installation. This directory can be opened easily by selecting ``Preferences > Browse Packages...`` in Sublime Text 2.
That's it. Now you should be able to open files with the ``.pas`` extension in Sublime Text 2 and they'll automatically use the syntax highlighting I've defined.
A build system for disassembling compiled Papyrus files is also included in this package.
Update
------
- < 1.4 to >= 1.4
- If you're updating to version 1.4 or higher from a version prior to 1.4, you should also delete the following file from your Packages/User directory:
``Disassemble Papyrus.sublime-build``
- 1.4 to 1.5
- If you're updating from version 1.4 to version 1.5, you should also delete the ``Compiled Papyrus`` directory from your Packages directory.
Uninstallation
==============
Just delete the ``Papyrus Assembly`` folder from your Packages directory to uninstall this package.
Use
===
To assemble these files into fully compiled scripts, press your ``Build`` keyboard shortcut (``Ctrl+B`` or ``F7`` both work by default) or select ``Build`` under ``Tools``. For this to work, either ``Papyrus Assembly`` or ``Automatic`` need to be selected under ``Tools > Build System``.
To use the ``Disassemble Papyrus`` build system to generate assembly files from compiled scripts, open up the compiled script in Sublime Text 2 (it should have a file extension of ``.pex``), just run the build system either from ``Build`` under ``Tools`` or via the keyboard shortcut. Either ``Disassemble Papyrus`` or ``Automatic`` should be selected under ``Tools > Build System``.
If either of the build packages doesn't work right away, you may need to alter them to match your Skyrim installation directory. Open up the relevant ``.sublime-build file`` and edit the path to match your Skyrim installation directory.
Generating Assembly Files
-------------------------
If you're a Sublime Text 2 user and a Papyrus scripter, you probably already have the Papyrus build system set up, thanks to the instructions on the Creation Kit Wiki. If not, I suggest you do that now - `Sublime Text Setup `_
Note that the Papyrus Compiler and Papyrus Assembler are both components of the Creation Kit.
In order to easily generate Papyrus assembly files, I recommend you manually edit your ``ScriptCompile.bat`` file (in the ``Papyrus Compiler`` folder in your Skyrim installation directory) to include the ``-keepasm`` command line argument.
Assembly files are generated in the same folder as the compiled script, not the source.
Here is the usage information for the Papyrus compiler as reported via its ``-?`` command line argument::
Usage:
PapyrusCompiler