Gawdl3y / atom-build-papyrus

atom-build provider for Papyrus
MIT License
3 stars 0 forks source link

build-papyrus package for Atom

Downloads Version Dependency status License

A build provider for the Atom build package that handles Papyrus projects and manual build configuration.
For Papyrus syntax highlighting, use the language-papyrus package.

Usage

If your Papyrus compilers are not in their default locations, then you must configure the compiler paths in the package's settings. These are used based on the active game for the project file/configuration.
Skyrim default: C:\Program Files (x86)\Steam\SteamApps\common\Skyrim\Papyrus Compiler\PapyrusCompiler.exe
Fallout 4 default: C:\Program Files (x86)\Steam\SteamApps\common\Fallout 4\Papyrus Compiler\PapyrusCompiler.exe

To build, use build:trigger (CtrlAltB or F9).
You can select which build target you'd like to use with build:select-active-target (CtrlAltT or F7).
There are multiple build targets: default, release, and final release (only the default target is available for Skyrim).

If you're using a project file, the release and final values in there will still be taken into account by the compiler. Keep them false in the project file for the build targets to work properly.
If you have both a project file and a fully-buildable configuration file present, targets will be available for both.

Papyrus project files

Make sure the directory you have open in Atom contains your project file in its root. If you add, remove, or rename a project file, make sure you run build:refresh-targets in the command palette. Skyrim does not support project files.

Manual configuration

If you aren't using project files, then you can also configure the build settings in a JSON, CSON, or YAML configuration file called .build-papyrus.json, .build-papyrus.cson, or .build-papyrus.yml. This should also go in your root directory. The possible settings:

Option Type Default Details
game String Required if compiler is not defined. Must be one of skyrim or fallout4.
compiler String Appropriate game path Required if game is not defined. Full path to the Papyrus compiler you wish to use.
flags String Appropriate game file Required if game is not defined. The compiler flags file.
output String . The directory for the compiler to output to.
imports Array Required. An array of strings that are full paths to script import directories.
optimize Boolean true Whether or not the compiler should optimize its output.
release Boolean false Whether or not the compiler should build for release (strip out debugOnly). Instead of specifying this, you can select the "Papyrus release" build target.
final Boolean false Whether or not the compiler should build for final release (strip out betaOnly). Instead of specifying this, you can select the "Papyrus final release" build target.

Triggering a build will compile the file you currently have opened.

Example configuration (with game)

.build-papyrus.yml:

game: fallout4
output: C:\Program Files (x86)\Steam\SteamApps\common\Fallout 4\Data\Scripts\
imports:
    - C:\Program Files (x86)\Steam\SteamApps\common\Fallout 4\Data\Scripts\Source\User
    - C:\Program Files (x86)\Steam\SteamApps\common\Fallout 4\Data\Scripts\Source\DLC03
    - C:\Program Files (x86)\Steam\SteamApps\common\Fallout 4\Data\Scripts\Source\DLC02
    - C:\Program Files (x86)\Steam\SteamApps\common\Fallout 4\Data\Scripts\Source\DLC01
    - C:\Program Files (x86)\Steam\SteamApps\common\Fallout 4\Data\Scripts\Source\Base

Example configuration (without game)

.build-papyrus.yml:

compiler: C:\Program Files (x86)\Steam\SteamApps\common\Fallout 4\Papyrus Compiler\PapyrusCompiler.exe
flags: Institute_Papyrus_Flags.flg
output: C:\Program Files (x86)\Steam\SteamApps\common\Fallout 4\Data\Scripts\
imports:
    - C:\Program Files (x86)\Steam\SteamApps\common\Fallout 4\Data\Scripts\Source\User
    - C:\Program Files (x86)\Steam\SteamApps\common\Fallout 4\Data\Scripts\Source\DLC03
    - C:\Program Files (x86)\Steam\SteamApps\common\Fallout 4\Data\Scripts\Source\DLC02
    - C:\Program Files (x86)\Steam\SteamApps\common\Fallout 4\Data\Scripts\Source\DLC01
    - C:\Program Files (x86)\Steam\SteamApps\common\Fallout 4\Data\Scripts\Source\Base

Example configuration (with everything)

.build-papyrus.yml:

game: fallout4
compiler: C:\Program Files (x86)\Steam\SteamApps\common\Fallout 4\Papyrus Compiler\PapyrusCompiler.exe
flags: Institute_Papyrus_Flags.flg
output: C:\Program Files (x86)\Steam\SteamApps\common\Fallout 4\Data\Scripts\
imports:
    - C:\Program Files (x86)\Steam\SteamApps\common\Fallout 4\Data\Scripts\Source\User
    - C:\Program Files (x86)\Steam\SteamApps\common\Fallout 4\Data\Scripts\Source\DLC03
    - C:\Program Files (x86)\Steam\SteamApps\common\Fallout 4\Data\Scripts\Source\DLC02
    - C:\Program Files (x86)\Steam\SteamApps\common\Fallout 4\Data\Scripts\Source\DLC01
    - C:\Program Files (x86)\Steam\SteamApps\common\Fallout 4\Data\Scripts\Source\Base
optimize: true
release: false
final: false

What is Papyrus?

Papyrus is a scripting language for the Creation Engine, the game engine that The Elder Scrolls V: Skyrim and Fallout 4 run on. Mods for them use this language to make things happen in the game. Want to learn more about it? Check out the Papyrus reference for Skyrim or Fallout 4.