Jump to content

Notepad++ config for Papyrus


Recommended Posts

View File

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


"C:\Program Files (x86)\Steam\steamapps\common\skyrim\Papyrus Compiler\NPPScriptCompile.bat" "$(FILE_NAME)" "$(CURRENT_DIRECTORY)"

  • 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


  • Submitter
    CPU
  • Submitted
    07/09/2016
  • Category
  • Requires
    Notepad++
  • Special Edition Compatible

 

Link to comment

You are very welcome @Mergatroid Skittle. I use it and I hope this can ease the development life of some (scripting) modders.

For the autocomplete there are still a bunch of functions that are not recognized (and so not completed.)

Probably I will do an update when SexLab 1.60 will be out, including all its (public) functions.

 

 

Link to comment

Confirm download is fixed

{Edit}
One tip instead of using the Default Template Name;
UserDefineLang.XML

Rename the File to anything useful to you, I used;
Skyrim Papyrus Config.XML

Before copying to (@CPU: You missed the Roaming folder in description);
C:\Users\<Your User Name>\AppData\Roaming\Notepad++

The name is just so you know what it is, the function name used by Notepad++ is inside the XML file.
Then you click on Language Menu and Select;
Define your Language…

Just like you do to actually write a User Defined Language, but select the;
Import…

Button, which opens a window in the correct folder (for Me, but navigate to it if needed) and choose your file, in my case;
C:\Users\<Your User Name>\AppData\Roaming\Notepad++\Skyrim Papyrus Config.XML

That's it, Notepad++ will list the new user language and any others you use. You can do this with many User Defined Languages and keep the default template as well.

Link to comment

Thanks again Uhuru N'Uru, I had problems using a different name for the language file.

If you do any updated on the config, the file it is not updated, but defaultLanguage gets your modifications.

 

I will update also the path for the file in the main page.

 

Link to comment

Thanks again Uhuru N'Uru, I had problems using a different name for the language file.

If you do any updated on the config, the file it is not updated, but defaultLanguage gets your modifications.

 

I will update also the path for the file in the main page.

 

My advice was given to users of your file, more than to you, the writer. I forgot to change it's name and when I ran Notepad++ all my custom Defimitions had gone.

Not a big deal if they are saved under different file names, as I have done.

 

Would have been if I had always previously used and then replaced the UserDefineLang.XML though.

 

Link to comment
  • 1 month later...
  • 11 months later...
Guest ffabris

Very handy, thank you! Some feedback from a linux/wine user which may be helpful to Windows people too. I'll try to condense many hours of frustrated experiments as much as possible. Basically, the info here didn't work for me. I can't run a bat from NPP, and running PapyrusCompiler.exe directly doesn't allow me to redirect output to a file.

 

So, a bit of research led me to NppExec. Using that instead of Run... has one added benefit: console output (stdout) is shown in an NPP window, which is very convenient.

Link to comment

Very handy, thank you! Some feedback from a linux/wine user which may be helpful to Windows people too. I'll try to condense many hours of frustrated experiments as much as possible. Basically, the info here didn't work for me. I can't run a bat from NPP, and running PapyrusCompiler.exe directly doesn't allow me to redirect output to a file.

 

So, a bit of research led me to NppExec. Using that instead of Run... has one added benefit: console output (stdout) is shown in an NPP window, which is very convenient.

 

Thanks for this extra info.

I am going to try that.

Link to comment

It works like a charm.

 

Now I am slightly editing the config of NppExec and the .bat file to give the ability to jump to the line of code by clicking on the console line.

 

Link to comment

For someone who has always gotten by with just using the CK and notepad (normal notepad) what am I missing by not using something like this? I subscribe to the KISS principle so adding an application to the list of things that I never used before requires good reason.

Link to comment
Guest ffabris

I had just one reason for switching: my scripts outgrew the max size CK can handle (for source). Now that I have switched, I kinda like the added features like syntax highlighting.

Link to comment

For someone who has always gotten by with just using the CK and notepad (normal notepad) what am I missing by not using something like this? I subscribe to the KISS principle so adding an application to the list of things that I never used before requires good reason.

 

KISSing is good. Always.

 

But when you start doing some serious coding (and, trust me, I do serious coding) then the basic editor of CK or standard Notepad are a limitation to write correctly and quickly your code.

 

If you just do less than a dozen lines of code, then it does not matter. But write a mod with thousands lines of code and then you need a real tool (Notepadd++ (preferred by me) or Sublime (preferred by @Ashal)

 

 

EDIT: extra features:

  • Syntax highlighting
  • Auto complete
  • Folding/Unfolding of parts of code (with automatic code checking for missing close items)
  • Direct compiling, including compiling through Mod Organizer
  • Index of functions/states/events
  • Automatic commenting/uncommenting of the selected lines
  • The next beautiful girl that will meet you will give to you her pussy without questions (this is still in beta mode, sorry...)

 

Link to comment

For someone who has always gotten by with just using the CK and notepad (normal notepad) what am I missing by not using something like this? I subscribe to the KISS principle so adding an application to the list of things that I never used before requires good reason.

 

Windows Notepad? Damn, that's hardcore. The main two reasons I prefer Notepad++ for Papyrus is:

 

  1. The Undo function goes as many steps back as you like, Notepad can only undo your last step.
  2. Find In Files function. Have it point at the \Scripts\Source\ folder and you can find anything you want even when you're not sure what script it's on.
Link to comment

 

For someone who has always gotten by with just using the CK and notepad (normal notepad) what am I missing by not using something like this? I subscribe to the KISS principle so adding an application to the list of things that I never used before requires good reason.

 

Windows Notepad? Damn, that's hardcore. The main two reasons I prefer Notepad++ for Papyrus is:

 

  1. The Undo function goes as many steps back as you like, Notepad can only undo your last step.
  2. Find In Files function. Have it point at the \Scripts\Source\ folder and you can find anything you want even when you're not sure what script it's on.

 

 

Oh my god, you've already sold me with the thought of an undo option. I am incredibly adept at clicking things by accident at the most inopportune  times.

 

I've always just used the CK editor, though sometimes I do write more complex scripts in windows notepad (if I want to see more of the script at one time).

Link to comment

 

...Find In Files function. Have it point at the \Scripts\Source\ folder and you can find anything you want even when you're not sure what script it's on.

 

 

And works just fine if you are editing source files in the Mod Organized mod folders. Just be sure the path is set correctly.

Link to comment
  • 2 months later...

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


"C:\Program Files (x86)\Steam\steamapps\common\skyrim\Papyrus Compiler\NPPScriptCompile.bat" "$(FILE_NAME)" "$(CURRENT_DIRECTORY)"

  • 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

 



Click here to download this file

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more information, see our Privacy Policy & Terms of Use