Difference between revisions of "Atom Setup"

1,136 bytes added ,  01:02, 12 June 2016
Added more detailed installation instructions and switched to build-papyrus
imported>Gawdl3y
(Added message to error matching)
imported>Gawdl3y
(Added more detailed installation instructions and switched to build-papyrus)
Line 1: Line 1:
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 [https://atom.io/ official Atom site]. Atom has an extremely flexible package system that allows customization of virtually everything about the editor.
Atom is a completely free, 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 [https://atom.io/ official Atom site].
Atom's interface and functionality is very similar to Sublime Text, so it's a fairly painless transition if you have experience with it.
Atom has an extremely flexible package system that allows customization of virtually everything about the editor.


== Syntax highlighting and snippets ==
==Installation==
Syntax highlighting for Papyrus and Papyrus assembly is provided by the [https://atom.io/packages/language-papyrus language-papyrus] package. To install it, follow these instructions:
===Install Atom===
#Go to [https://atom.io/ the Atom website], download the setup file, and run it.


=== Method 1 ===
===Install Packages===
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.
Syntax highlighting and snippets are provided by the [https://atom.io/packages/language-papyrus language-papyrus] package.
Building is provided by the [https://atom.io/packages/build build] and [https://atom.io/packages/build-papyrus build-papyrus] packages.
#In Atom, open the settings tab (File -> Settings, or Ctrl + Comma)
#Select the Install tab on the side
#Search for <code>language-papyrus</code>, then click install on the package when the results appear
#Repeat the previous step for <code>build</code> and <code>build-papyrus</code>
#To see compiler errors inline with your code, also install the <code>[https://atom.io/packages/linter linter]</code> package


=== Method 2 ===
Run <code>apm install language-papyrus</code> in a command prompt.


== Quick compile ==
If your Papyrus Compiler isn't in the default location (<code>C:\Program Files (x86)\Steam\SteamApps\common\Skyrim\Papyrus Compiler\PapyrusCompiler.exe</code>), then you must set it in the build-papyrus package settings:
Obtain the [https://atom.io/packages/build 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 <code>Skyrim\Data\Scripts\Source</code> directory. Change the path in the <code>cwd</code> setting if you need to (make sure to use double-backslashes). If you don't have the DLC, just remove them from the <code>-import</code> argument.
#In Atom, open the settings tab (File -> Settings, or Ctrl + Comma)
<pre>{
#Select the Packages tab on the side
"cmd": "Papyrus Compiler\\PapyrusCompiler.exe",
#Search for <code>build-papyrus</code> or find it in the list, and click on Settings
"cwd": "C:\\Program Files (x86)\\Steam\\SteamApps\\common\\Skyrim\\",
#Change the compiler path setting to your appropriate path
"sh": false,
 
"args": [
==Usage==
"{FILE_ACTIVE}",
Then, place the below text in a file called '''.build-papyrus.yml''' (yes, with the leading dot!) in your <code>Skyrim\Data\Scripts\Source</code> directory. If you don't have the DLC, just remove them from the <code>imports</code> list.
"-import=Data\\Scripts\\Source;Data\\Scripts\\Source\\Dawnguard;Data\\Scripts\\Source\\Dragonborn;Data\\Scripts\\Source\\Hearthfire",
<pre>game: skyrim
"-output=Data\\Scripts",
imports:
"-flags=TESV_Papyrus_Flags.flg"
    - C:\Program Files (x86)\Steam\SteamApps\common\Skyrim\Data\Scripts\Source
],
    - C:\Program Files (x86)\Steam\SteamApps\common\Skyrim\Data\Scripts\Source\Dawnguard
"env": {},
    - C:\Program Files (x86)\Steam\SteamApps\common\Skyrim\Data\Scripts\Source\Dragonborn
"errorMatch": "\n(?<file>[A-Za-z0-9_:\\-\\.\\/ \\\\]+\\.(psc|PSC))\\((?<line>[0-9]+),(?<col>[0-9]+)\\): (?<message>.+)"
    - C:\Program Files (x86)\Steam\SteamApps\common\Skyrim\Data\Scripts\Source\Hearthfire
}</pre>
output: C:\Program Files (x86)\Steam\SteamApps\common\Skyrim\Data\Scripts\
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'''.<br />
optimize: true</pre>
After placing the .build-papyrus.yml file there, any of the scripts you open in Atom will be able to be compiled simply by pressing '''Ctrl-Alt-B''' or '''F9'''.<br />
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.
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 ===
=== 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. <code>Mod Organizer\mods\Ultra Cool Mod\Scripts\Source</code>. Some tweaking to the file needs to be done, namely changing the <code>-import</code> and <code>-output</code> arguments. Using the prior mod example, your import and output lines would look similar to this:
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 '''.build-papyrus.yml''' file in the mod's scripts source directory that you're working on, e.g. <code>Mod Organizer\mods\Ultra Cool Mod\Scripts\Source</code>. Some tweaking to the file needs to be done, namely changing the <code>imports</code> and <code>output</code> settings. Using the prior mod example, your imports and output settings would look similar to this:
<pre>"-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",
<pre>imports:
"-output=C:\\Program Files (x86)\\Mod Organizer\\mods\\Ultra Cool Mod\\Scripts",</pre>
    - C:\Program Files (x86)\Mod Organizer\mods\Ultra Cool Mod\Scripts\Source
If your scripts depend on another mod, just add its script source directory to the <code>-import</code> argument as well, after your mod's directory, but before the Skyrim and DLC directories. Example:
    - C:\Program Files (x86)\Steam\SteamApps\common\Skyrim\Data\Scripts\Source\Dawnguard
<pre>"-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",</pre>
    - C:\Program Files (x86)\Steam\SteamApps\common\Skyrim\Data\Scripts\Source\Dragonborn
    - C:\Program Files (x86)\Steam\SteamApps\common\Skyrim\Data\Scripts\Source\Hearthfire
    - C:\Program Files (x86)\Steam\SteamApps\common\Skyrim\Data\Scripts\Source
output: C:\Program Files (x86)\Mod Organizer\mods\Ultra Cool Mod\Scripts</pre>
If your scripts depend on another mod, just add its script source directory to the <code>imports</code> list as well, after your mod's directory, but before the Skyrim and DLC directories. Example:
<pre>imports:
    - C:\Program Files (x86)\Mod Organizer\mods\Ultra Cool Mod\Scripts\Source
    - C:\Program Files (x86)\Mod Organizer\mods\Some Other Mod\Scripts\Source
    - C:\Program Files (x86)\Steam\SteamApps\common\Skyrim\Data\Scripts\Source\Dawnguard
    - C:\Program Files (x86)\Steam\SteamApps\common\Skyrim\Data\Scripts\Source\Dragonborn
    - C:\Program Files (x86)\Steam\SteamApps\common\Skyrim\Data\Scripts\Source\Hearthfire
    - C:\Program Files (x86)\Steam\SteamApps\common\Skyrim\Data\Scripts\Source</pre>




Anonymous user