Difference between revisions of "Papyrus Compiler Reference"

760 bytes added ,  06:59, 15 April 2017
no edit summary
imported>SLiesegang
imported>Serenity
 
(3 intermediate revisions by 3 users not shown)
Line 10: Line 10:


=== Outside the Creation Kit ===
=== Outside the Creation Kit ===
Power-users may want to execute the compiler via the command line, or via a batch file, or even through your favorite text editor (we provide setup directions for [[Sublime_Text_Setup|Sublime Text]] and [[Notepad++_Setup|Notepad++]]. In order to do so, you'll want to run the PapyrusCompiler.exe inside the "Papyrus Compiler" folder, which can be found in the location where you installed the editor. Of course, you'll need to specify a series of command line arguments to tell it what to do. If you run the compiler without any command line parameters, or with erroneous ones, it will spit out a set of help text to remind you what they are.
Power-users may want to execute the compiler via the command line, or via a batch file, or even through your favorite text editor (we provide setup directions for [[Sublime_Text_Setup|Sublime Text]] and [[Notepad++_Setup|Notepad++]]). In order to do so, you'll want to run the PapyrusCompiler.exe inside the "Papyrus Compiler" folder, which can be found in the location where you installed the editor. Of course, you'll need to specify a series of command line arguments to tell it what to do. If you run the compiler without any command line parameters, or with erroneous ones, it will spit out a set of help text to remind you what they are.


The very first thing you pass to the compiler is the name of the script (or folder, if you're using the -all flag) to compile.
The very first thing you pass to the compiler is the name of the script (or folder, if you're using the -all flag) to compile.
Line 26: Line 26:


This command line parameter specifies a list of folders that the compiler will look in for other scripts and the flag file. You'll want to at least point this at the folder that contains all the game's base scripts. Multiple folders are separated by semicolons.
This command line parameter specifies a list of folders that the compiler will look in for other scripts and the flag file. You'll want to at least point this at the folder that contains all the game's base scripts. Multiple folders are separated by semicolons.
If you happen to have multiple import sources, make sure that none of these have scripts with matching names. Only the first occurrence will be imported, every other source of the same name is ignored.


==== Output ====
==== Output ====
Line 54: Line 56:
Common errors emitted by the compiler are listed on [[Papyrus Compiler Errors|another page]]
Common errors emitted by the compiler are listed on [[Papyrus Compiler Errors|another page]]


== Disassembling scripts with PapyrusAssembler.exe ==
PapyrusAssembler must be in the same directory as your pas/pex files. This does NOT convert pex files to psc files, it converts them to a semi readable assembly-like syntax.
<pre>PapyrusAssembler.exe scriptWithoutExtenstion -D</pre>
===Decompile all pex files in a directory===
From cmd:
<pre>for /F "tokens=*" %F in ('dir /b *.pex') do PapyrusAssembler.exe %~nF -D -Q</pre>
From a batch file:
<pre>for /F "tokens=*" %%F in ('dir /b *.pex') do PapyrusAssembler.exe %%~nF -D -Q</pre>
{{Languages}}
[[Category: Scripting]]
[[Category: Scripting]]
[[Category: Papyrus]]
[[Category: Papyrus]]
Anonymous user