Atom Setup

Revision as of 00:06, 29 April 2016 by imported>Gawdl3y (Added message to error matching)

Atom is an open-source, highly-extensible text editor based on Chromium and Node.js. It was created and is being actively developed by the GitHub team. It can be downloaded from the official Atom site. Atom has an extremely flexible package system that allows customization of virtually everything about the editor.

Syntax highlighting and snippets

Syntax highlighting for Papyrus and Papyrus assembly is provided by the language-papyrus package. To install it, follow these instructions:

Method 1

Open the settings tab (File -> Settings, or Ctrl + Comma), select the "Install" tab on the side, and search for "language-papyrus". When the results appear, click "Install" on the package.

Method 2

Run apm install language-papyrus in a command prompt.

Quick compile

Obtain the build package the same way as above. Then, place the below text in a file called .atom-build.json (yes, with the leading dot!) in your Skyrim\Data\Scripts\Source directory. Change the path in the cwd setting if you need to (make sure to use double-backslashes). If you don't have the DLC, just remove them from the -import argument.

{
	"cmd": "Papyrus Compiler\\PapyrusCompiler.exe",
	"cwd": "C:\\Program Files (x86)\\Steam\\SteamApps\\common\\Skyrim\\",
	"sh": false,
	"args": [
		"{FILE_ACTIVE}",
		"-import=Data\\Scripts\\Source;Data\\Scripts\\Source\\Dawnguard;Data\\Scripts\\Source\\Dragonborn;Data\\Scripts\\Source\\Hearthfire",
		"-output=Data\\Scripts",
		"-flags=TESV_Papyrus_Flags.flg"
	],
	"env": {},
	"errorMatch": "\n(?<file>[A-Za-z0-9_:\\-\\.\\/ \\\\]+\\.(psc|PSC))\\((?<line>[0-9]+),(?<col>[0-9]+)\\): (?<message>.+)"
}

After placing the .atom-build.json file there, any of the scripts you open in Atom will be able to be compiled simply by pressing Ctrl-Alt-B.
If there are errors during compilation, clicking a filename in the build output window will take you directly to the spot in your code in which the error occurred. Ctrl-Alt-G will also jump between any errors.

Mod Organizer

One of the most common problem modders have with Mod Organizer is getting Papyrus compilation working correctly. Setting up Atom to work with Mod Organizer is simple. You do not need to launch Atom through Mod Organizer. Instead, just place the above .atom-build.json file in the mod's scripts source directory that you're working on, e.g. Mod Organizer\mods\Ultra Cool Mod\Scripts\Source. Some tweaking to the file needs to be done, namely changing the -import and -output arguments. Using the prior mod example, your import and output lines would look similar to this:

"-import=C:\\Program Files (x86)\\Mod Organizer\\mods\\Ultra Cool Mod\\Scripts\\Source;Data\\Scripts\\Source;Data\\Scripts\\Source\\Dawnguard;Data\\Scripts\\Source\\Dragonborn;Data\\Scripts\\Source\\Hearthfire",
"-output=C:\\Program Files (x86)\\Mod Organizer\\mods\\Ultra Cool Mod\\Scripts",

If your scripts depend on another mod, just add its script source directory to the -import argument as well, after your mod's directory, but before the Skyrim and DLC directories. Example:

"-import=C:\\Program Files (x86)\\Mod Organizer\\mods\\Ultra Cool Mod\\Scripts\\Source;C:\\Program Files (x86)\\Mod Organizer\\mods\\Some Other Mod\\Scripts\\Source;Data\\Scripts\\Source;Data\\Scripts\\Source\\Dawnguard;Data\\Scripts\\Source\\Dragonborn;Data\\Scripts\\Source\\Hearthfire",



Language: English