Skyrim
0 of 0

File information

Last updated

Original upload

Created by

Cipscis

Uploaded by

Cipscis

Virus scan

Safe to use

Documentation

Readme

View as plain text

Name:
Papyrus Assembly package for Sublime Text 2

By:
Cipscis (Mark Hanna)

Version:
1.00

Description:
This is a package for Sublime Text 2 that makes it easier to view Papyrus assembly files (file extension .pas). 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 decompile 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 can usually be found here:
"C:\Users\username\AppData\Roaming\Sublime Text 2\Packages"

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

Uninstallation:
Just delete the "Papyrus Assembly" folder from your Packages directory to uninstall this package.

If you've also installed the "Decompile Papyrus" build system for decompiling scripts, then delete the "Decompile Papyrus.sublime-build" file from your Packages/User folder.

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 "Decompile 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), select "Decompile Papyrus" under Tools > Build System, then run the build system either from "Build" under Tools or via the keyboard shortcut.

If either of the build packages doesn't work right away, you may need to alter it to match your Skyrim installation directory. Open up the Papyrus Assembly.sublime-build file and edit the path to match your own.

Generating Assembly Files:
If you're a Sublime Text 2 user and a Papyrus scripter, you probably already have the Papyrus build system availabe via the Creation Kit wiki set up. 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 []

object Specifies the object to compile. (-all is not specified)
folder Specifies the folder to compile. (-all is specified)
arguments One or more of the following:
-debug|d
Turns on compiler debugging, outputting dev information to the screen.
-optimize|op
Turns on optimization of scripts.
-output|o=
Sets the compiler's output directory.
-import|i=
Sets the compiler's import directories, separated by semicolons.
-flags|f=
Sets the file to use for user-defined flags.
-all|a
Invokes the compiler against all psc files in the specified directory
(interprets object as the folder).
-quiet|q
Does not report progress or success (only failures).
-noasm
Does not generate an assembly file and does not run the assembler.
-keepasm
Keeps the assembly file after running the assembler.
-asmonly
Generates an assembly file but does not run the assembler.
-?
Prints usage information.

Here is the usage information for the Papyrus assembler as reported via its -? command line argument:

Usage:
PapyrusAssembler object [-D] [-V] [-Q] [-A] [-S] [-?]

object Specifies the object to be assembled or disassembled. Assembly looks
for a ".pas" extension. Disassembly looks for a ".pex" extension.
-D Disassembles the object, instead of assembling it.
-V Turns on verbose mode.
-Q Turns on quiet mode. (No status messages, only errors)
-A Do not assemble/disassemble the file, just load and analyze.
-S Strips debugging info from a compiled file. Cannot be used with -A
or -D
-? Prints this usage information

Keep in mind that the compiler expects a file extension, whereas the assembler expects the file name *without* an extension.

Change Log:
1.00 - 12th September 2012
Initial Release

Permissions:
Feel free to edit and redistribute this file (in edited or unedited form) anywhere you like without contacting me. I ask only the following:
- Include adequate documentation, preferably this readme (potentially modified as appropriate)
- Please provide a link to the original download location on Skyrim Nexus
- If the package is unedited, please credit me as the author
- If the package is edited, please credit me as the author of the original package and include in your documentation the version number of the package that you used as a template for your modified package