-
Notifications
You must be signed in to change notification settings - Fork 18
Compilation
The Papyrus Language extension provides features related to source code compilation.
Do you have a complicated build system, or something simpler? VS Code will accommodate in any case. There are many ways to compile Papyrus scripts with VS Code. Read more about the Papyrus Compiler.
The Project Explorer for Papyrus provides compilation support.
Read more about the Project Explorer.
The VS Code Integrated Terminal provides a Command Line Interface (CLI) inside the editor.
When an integrated terminal is opened, it will initially start with a current working directory at the root of your VS Code Workspace. This can be convenient as you don't have to switch windows or alter the state of an existing terminal to perform a quick command-line task.
To open the terminal:
- Use the
Ctrl+`
keyboard shortcut with the backtick character. - Use the View > Terminal menu command.
- From the Command Palette (
Ctrl+Shift+P
), use the View: Toggle Integrated Terminal command.
The compiler may be executed using the CLI in many ways. Some examples are single files, directories, and Papyrus Projects. Read more about the Papyrus Compiler and its arguments.
The CLI commands for single file compilation.
<PapyrusCompiler.exe> <psc> -i="<scripts folder>" -o="Data\Scripts" -f="Institute_Papyrus_Flags.flg"
The CLI commands for directory compilation.
<PapyrusCompiler.exe> <folder> -i="<scripts folder>" -o="Data\Scripts" -f="TESV_Papyrus_Flags.flg"
The CLI commands for Papyrus Project compilation is only supported in Fallout 4.
<PapyrusCompiler.exe> <ppj>"
- Copy the full file path string to a Papyrus Project intended for compilation.
- Open the VS Code Integrated Terminal and set the current working directory to the Papyrus Compiler folder.
- Execute the "PapyrusCompiler.exe" where the first argument is the file path of a Papyrus Project (*.ppj).
<PapyrusCompiler.exe> "the\path\to\your\project.ppj"
A VS Code Task is a special workspace file ...\MyWorkSpace\.vscode\tasks.json
.
A task may be used to execute the compiler, call a batch file, or start any other process.
For single file builds the compiler can be called directly with arguments from a task.
The example below compiles a single script called MyScript.psc
which is located Skyrim\Data\Scripts\Source\User
.
The compiled script will be output to Skyrim\Data\Scripts\Source\User_Output
.
{
"version": "2.0.0",
"tasks": [
{
"label": "Papyrus Compile File (Skyrim)",
"group": "build",
"type": "process",
"command": "${config:papyrus.skyrim.installPath}\\Papyrus Compiler\\PapyrusCompiler.exe",
"options": {
"cwd": "${config:papyrus.skyrim.installPath}\\Papyrus Compiler"
},
"args": [
{
"value": "${config:papyrus.skyrim.installPath}\\Data\\Scripts\\Source\\User\\MyScript.psc",
"quoting": "strong"
},
{
"value": "-import=${config:papyrus.skyrim.installPath}\\Data\\Scripts\\Source\\User;${config:papyrus.skyrim.installPath}\\Data\\Scripts\\Source",
"quoting": "strong"
},
{
"value": "-output=${config:papyrus.skyrim.installPath}\\Data\\Scripts\\User_Output",
"quoting": "strong"
},
{
"value": "-flags=TESV_Papyrus_Flags.flg",
"quoting": "strong"
}
],
"problemMatcher": []
}
]
}
For directory builds the compiler can be called directly with arguments from a task.
{
"version": "2.0.0",
"tasks": [
{
"label": "Papyrus Compile Directory (Fallout 4)",
"group": "build",
"type": "process",
"command": "${config:papyrus.fallout4.installPath}\\Papyrus Compiler\\PapyrusCompiler.exe",
"options": {
"cwd": "${config:papyrus.fallout4.installPath}\\Papyrus Compiler"
},
"args": [
{
"value": "${config:papyrus.fallout4.installPath}\\Data\\Scripts\\Source\\User",
"quoting": "strong"
},
{
"value": "-import=${config:papyrus.fallout4.installPath}\\Data\\Scripts\\Source\\User;${config:papyrus.fallout4.installPath}\\Data\\Scripts\\Source\\Base",
"quoting": "strong"
},
{
"value": "-output=${config:papyrus.fallout4.installPath}\\Data\\Scripts",
"quoting": "strong"
},
{
"value": "-flags=Institute_Papyrus_Flags.flg",
"quoting": "strong"
},
{
"value": "-all",
"quoting": "strong"
}
],
"problemMatcher": []
}
]
}
Extension
Features
- Language Definition
- IntelliSense
- Code Navigation
- Refactoring
- Compilation
-
Debugging
- Debug View
- [Debug Console](Debug Console)
- [Assembly View](Assembly View)
Creation Engine
Language
Help