Difference between revisions of "Notepad++ Setup"

4,392 bytes added ,  10:58, 11 January 2018
→‎Setting up a quick compile: Added Fully Integrated Compiler with NppExec (Best Choice)
imported>Azzendix
m (Fix Syntax highlighting syntax in "2.10 Papyrus Function List for Notepad++" topic to show correctly on wiki page.)
imported>J.C.
(→‎Setting up a quick compile: Added Fully Integrated Compiler with NppExec (Best Choice))
Line 25: Line 25:
There is also a more advanced compiler script avaiable that offers the feature of defining additional import directories and some more comfort.
There is also a more advanced compiler script avaiable that offers the feature of defining additional import directories and some more comfort.
{{User:Schnusch/Notepad++/Papyrus Compiler}}
{{User:Schnusch/Notepad++/Papyrus Compiler}}
===Fully Integrated Compiler with NppExec (Best Choice)===
The best way to integrate any compiler into Notepad++ is to use the NppExec plugin. Your compile output will appear in a window in Notepad++, you can easily copy-paste from it, it will be in color, and you can double-click on any error and it will jump you right to the line and column with the error in the editor. So, it will work like many modern IDEs do when working with compilation and errors.
The best way to use Notepad++ plugins is to to use the Plugin Manager. Unfortunately, as of Notepad++ version 7.5 and later the Plugin Manager was not shipped as part of the default plugins. At that time Notepad++ added an 64-bit build, and the Plugin Manager and many other plugins were not available for x64, so they removed it. However, that problem has since been fixed, and the Plugin Manager and many of the plugins now have x64 versions. So first, check to see if you have the 32-bit or 64-bit version of Notepad++. If it is installed in C:\Program Files (x86)\Notepad++ then you have the 32-bit. You should uninstall that and install the 64-bit version. You can download it here: https://notepad-plus-plus.org/download/v7.5.4.html (make sure to get it from the [u]Download 64-bit x64[/u] section). The latest version as of this writing is 7.5.4.
Then download and install the [https://github.com/bruderstein/nppPluginManager/releases/tag/v1.4.9 Plugin Manager]. The latest version of of this writing is version 1.4.9. Just download the PluginManager_v1.4.9_x64.zip, and unzip it to your C:\Program Files\Notepad++. It will add one file to the plugins directory, and one file to the updater directory.
Then, launch Notepad++ and go to the Plugions->Plugin Manager->Show Plugin Manager. Find NppExec in the list and select the checkbox next to it and select Install. The latest version as of this writing was 0.5.9.9. You may need to restart Notepad++ for the Plugin to take effect.
Now, select Plugins->NppExec->Execute... or press F6. Type the following into the execute dialog box, and press Save... and save it with the name "Papyrus Compiler (Debug)". NOTE: you can also add (Release) and (Release Final) versions of this exec too by adding the -r -op and -r -op -final to the end of the last command. Adjust any of the paths here to your preference, this is for Fallout 4 in the default install location with all the DLC, and working on scripts out of the Data\Scripts\Source\User directory. NOTE: this does not require any changes to the ScriptCompile.bat file (or the others), since they is not used. This invokes the compiler directly.
<div style="overflow-x: scroll;">
<source lang="dos">
npe_console -- m-
npp_save
set local fo4 = C:\Program Files (x86)\Steam\steamapps\common\Fallout 4\
set local scripts = $(fo4)\Data\Scripts
set local source = $(scripts)\Source
npp_console -
cd $(CURRENT_DIRECTORY)
npp_console +
"$(fo4)Papyrus Compiler\PapyrusCompiler.exe" "$(FILE_NAME)" -f="Institute_Papyrus_Flags.flg" -i="$(source)\user;$(source)\DLC06;$(source)\DLC05;$(source)\DLC04;$(source)\DLC03;$(source)\DLC02;$(source)\DLC01;$(source)\Base" -o="$(scripts)"
</source>
</div>
The select Plugins->NppExec->Console Output Filters... and set them up with these values as a place to start, then customize to your liking:
<div style="overflow-x: scroll;">
<source lang="text">
%FILE%(%LINE%,%CHAR%)* 0xC0 0x00 0x00
Compiling "*"* 0x00 0x00 0xC0
No output generated for* 0xA0 0x00 0x00
Compilation succeeded. 0x00 0xA0 0x00
</source>
</div>
And finally, setup the menu item and keyboard shortcut: Plugins->NppExec->Advanced Options... and find the Menu Item section (bottom left of the dialog), give the Menu Item a name "Papyrus Compiler (Debug)" and select the script "Papyrus Compiler (Debug)". Click Add/Modify and it will tell you to restart Notepad++ for the change to take effect, so do that. Now you will have a new menu item Plugins->NppExec->Papyrus Compiler (Debug). To bind a shortcut key to that, go to Settings->Shortcut Mapper...->Plugin Commands->Papyrus Compiler (Debug) and select a shortcut. I use Ctrl-F9 since I've been doing a lot of xEdit Scripting in Object Pascal using Delphi, and that's Delphi's default compile key. But use whatever key you'd like, Notepad++ will tell you if there is a conflict.
In the end, it should look like this:
[[File:Notepad++_Papyrus_Compiler_Integration.png]]


==Setting up Papyrus Language Definitions==
==Setting up Papyrus Language Definitions==
Anonymous user