File Name: Notepad++ config for Papyrus
File Submitter: CPU
File Submitted: 10 Jul 2016
File Category: Other
Requires: Notepad++Special Edition Compatible : Yes
Hello, I use Notepad++ to do all the coding for Papyrus.
Some useful syntax highlighter of function discovery are available here and there.
But I never found something that had a couple of options (mandatory for me):
- Ability to collapse Functions and Events without getting crazy about nested items
- Provide a valid auto-complete
- Compile directly in NP++ with the actual console visible inside Noptepad++
The files in attachment are an user defined language for Notepad++ (Papyrus_Skyrim) and a function discovery configurator (based on the work of Schnellzugs: http://schnellzugs.blogspot.com/2013/11/papyrus-function-list-in-notepad.html)
To use it, be aware that you cannot just replace the files. Or you will lose any other custom language you added to Notepad++.
Installation instructions:
- Be sure you are using the latest version of Notepad++ (6.9.2)
- You need to restart Noptepad++ to see the changes.
Papyrus Language, and syntax highlighting
- Open the menu "Language", and then "Define your language...", on the window that pops-up, click on "Import...", and get the file PapyrusLanguage.xml
Papyrus Function List
- Edit both the file %APPDATA%\Notepad++\functionList.xml, and the provided file functionList (to merge).xml.
- Inside functionList.xml, you will find a tag called <associationMap>, put inside a tag defined as: <association userDefinedLangName="Papyrus" id="papyrus_function"/> (it is inside functionList (to merge).xml as reference)
- Inside functionList.xml, you will find a tag called <parsers>, put inside the whole content of the <parsers> tag of the file functionList (to merge).xml. The content should be at the same levels of the other tags.
Compile Papyrus (also by editing files inside Mod Organizer folders) with full Console support
- Get NppExec plugin UNICODE version (The version I use is 0.5.3): https://sourceforge.net/projects/npp-plugins/files/NppExec/NppExec%20Plugin%20v0.5.3/NppExec_053_dll_Unicode.zip/download
- Extract the archive and move all the content of the archive (doc folder, NppExec folder, NppExec.dll) inside the folder "plugins" of Notepad++ install directory (E.g. C:\Program Files (x86)\Notepad++\plugins)
- Restart Notepad++
- Move the provided file NPPScriptCompile.bat inside the Skyrim\Papyrus Compiler\ folder.
- Open the menu "Plugins" -> "NppExec..." -> "Execute..."
- In the window that pops up paste this line:
- You may have to fix the path and the name of the script. Warning because the double quotes (") are really important.
- Click on "Save as...", and provide a name like "Compile Papyrus"
- Select "Plugins" -> "NppExec..." -> "Advanced Options..."
- Check the item in the top-left called "Place to the Macros submenu"
- On the bottom-left you have a drop-down called "Associated script", select your "Compile Papirus" script.
- Provide a name for it if you like (I use the same name: "Compile Papyrus")
- And click on Add/Modify (Notepad++ will warn you that it has to be restarted. Just close it and start it again)
- Open "Macro" -> "Modify Shortcut/Delete Macro..."
- In the window select "plugin commands" tab
- Search for the command you just added, select it, and click on Modify to add a keyboard shortcut (I use Alt+S, so I can save and then compile quickly.)
If you edit and compile just in Skyrim\Data\ or Fallout4\Data\ folders, then you are ready to go.
If you use Mod Organizer to keep and edit your mods, then you may want to add the dependencies of your mod too: Edit NPPScriptCompile - Extended.bat, and just put the extra references you need. Be aware that you need as first name of the directory the name of the folder that contains the mod in Mod Organizer\mods\ directory.
To activate the auto-complete just go in Notepad++ and open Settings->Preferences..
There is an autocomplete tab, just activate it.
In this version if you type FIXME, it will appear like: FIXME. With a yellow background.
You can collapse Functions, Events, States, if/elseIf/else/endIf statements.
You can also add a comment like like: ; ((- Some meaningful name
And close it with: ; -))
This will create a "spoiler" inside your code, useful to group and collapse whole sections of your code.
This version works (except the code compilation that requires a slightly different file, not difficult to create) also for Fallout4 Papyrus.
Enjoy.
CPU