Skip to content

Instantly share code, notes, and snippets.

@mrowrpurr
Last active October 22, 2024 15:56
Show Gist options
  • Save mrowrpurr/e164735e14ee6d07daf4f4217caf3714 to your computer and use it in GitHub Desktop.
Save mrowrpurr/e164735e14ee6d07daf4f4217caf3714 to your computer and use it in GitHub Desktop.
VS Code File Templates for Papyrus

Note: Check to verify the path in these files matches your Skyrim install folder (else change the paths)

To use these templates with the Papyrus Extension for Visual Studio Code:

  1. Install the extension
  2. Download the latest version of Pyro
  3. Browse to C:\Users\[YOUR USER]\.vscode\extensions\joelday.papyrus-lang-vscode-*\
  4. Delete everything in the pyro folder and replace it with the freshly downloaded version of pyro
  5. Open up the resources/sse folder
  6. Open skyrimse.ppj and replace the contents with the contents of the skyrimse.ppj in this Gist
  7. Open tasks.json and replace the contents with the contents of the tasks.json in this Gist

Now whenever you use the Papyrus extension to Generate Skyrim Special Edition Project Files, it will generate the updated files :)

You should tweak the .ppj template to best suit your needs.

If your path to Skyrim is different than the Steam default, be sure to update the path in these files.

<?xml version='1.0'?>
<PapyrusProject xmlns="PapyrusProject.xsd"
Flags="TESV_Papyrus_Flags.flg"
Game="sse"
Anonymize="true"
Output="Scripts"
Optimize="false"
Release="false"
Zip="false"
Package="false"
Final="false">
<Variables>
<!-- Set the name of your mod: -->
<Variable Name="ModName" Value="CHANGE THE MOD NAME HERE" />
<!-- The folder where you store all of your mods -->
<Variable Name="ModsFolder" Value="C:\[YOUR MODS FOLDER]" />
</Variables>
<Imports>
<!-- <Import>@ModsFolder\SKSE64\Scripts\Source</Import> -->
<Import>C:\Program Files (x86)\Steam\steamapps\common\Skyrim Special Edition\Data\Scripts\Source</Import>
</Imports>
<Folders>
<!-- Relative path to folder containing .psc Papyrus source code files for this project -->
<Folder>./Scripts/Source</Folder>
</Folders>
<!-- The following section is for .bsa archives. You can enable it by setting Package="true" in the PapyrusProject -->
<Packages Output=".">
<Package Name="@ModName" RootDir=".">
<Match In="Scripts">*.pex</Match>
<!-- <Match In="interface\translations">*.txt</Match> -->
</Package>
<!-- If you have any texture files, uncomment the following to create a Textures .bsa archive with texture files -->
<!-- <Package Name="@ModName - Textures" RootDir=".">
<Include>*.dds</Include>
</Package> -->
</Packages>
<!-- The following section is for .zip archive. You can enable it by setting Zip="true" in the PapyrusProject -->
<ZipFiles Output="Build">
<ZipFile Name="@ModName" RootDir="." Compression="deflate">
<Include>@ModName.esp</Include>
<Include NoRecurse="true">*.bsa</Include>
<Match In="Scripts\Source">*.psc</Match>
</ZipFile>
</ZipFiles>
<!-- This will remove any *.bsa files in this directory *after* the build, if there are any. Set UseInBuild="false" to disable. -->
<PostBuildEvent Description="Post-Build Remove BSA Files" UseInBuild="true">
<Command>del /s /q /f *.bsa</Command>
</PostBuildEvent>
</PapyrusProject>
{
"version": "2.0.0",
"tasks": [
{
"type": "pyro",
"projectFile": "skyrimse.ppj",
"gamePath": "C:\\Program Files (x86)\\Steam\\steamapps\\common\\Skyrim Special Edition\\",
"problemMatcher": [
"$PapyrusCompiler"
],
"label": "pyro: Compile Project (skyrimse.ppj)",
"group": {
"kind": "build",
"isDefault": true
}
}
]
}
@Kurisu-Null
Copy link

Thanks for the effort you put into this!

@keplerk
Copy link

keplerk commented May 18, 2024

Is this available for FO4 :( ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment