Jump to content

I can't get Notepad++ to work with Papyrus at all


randomtguy

Recommended Posts

Does anyone have Notepad++ working with Papyrus? I've tried the plugin on the Skyrim Nexus, I've tried sticking the XMLs from the CK wiki anywhere the damn program is supposed to look for them, I've tried another XML file I found elsewhere, I've tried importing said XMLs as user defined languages. Nothing works. Notepad++ won't recognise PSC files as files it can open or save as or do the auto-highlighting of variables etc it's supposed to. I don't even want to compile through it (yet anyway) I just want the highlighting and for Notepad++ to even recognise the language.

Edited by randomtguy
Link to comment
Share on other sites

Never got the Notepad++ papyrus plugin to work.

 

Notepad++ synax highlighting XML works fine (some FO4 objects/functions are missing) save this as PapyrusFallout4.xml then Menu:Language:DefineYourLanguage:Import:PapyrusFallout4.xml

 

 

Compile from Menu:Run works fine assuming you have yoru Papyrus compile batch files setup correctly:

Menu:Run:Run:C:\Program Files (x86)\Steam\steamapps\common\Fallout 4\Papyrus Compiler\ScriptCompile.Bat:Save:Name

Menu:Run:Run:C:\Program Files (x86)\Steam\steamapps\common\Fallout 4\Papyrus Compiler\ScriptCompileReleaseFinal.Bat:Save:Name

 

Somehow CK knows about it to "edit in external editor" ... forgot how that was enabled.

Link to comment
Share on other sites

The following is from a PM I sent to a friend, KitKat81, with the same problem. I mention this because some of the text is referring to KitKat's post back in 2018. I was planing to post this after KitKat confirmed I had it right but I think KitKat has moved on from FO4.

 

https://forums.nexusmods.com/index.php?/topic/6596801-setting-notepad-to-compile-scripts/?hl=%20notepad

 

I finally have Notepad++ compiling scripts and giving error report when it fails. I had to give up on the Papyrus++ plugin, I think the author simply abandoned it. That is the reason for a new thread here.
This is the bat file I used for a debug build:

Rem Debug Build. 
"%~dp0PapyrusCompiler" %1 -f="Institute_Papyrus_Flags.flg" -i="%~dp0..\Data\Scripts\Source\User;%~dp0..\Data\Scripts\Source\Base;%~dp0..\Data\Scripts\Source\User" -o="%~dp0..\Data\Scripts" 
pause

This is the bat file I used for Final Release build:

Rem Final rlease. removes debug and beta info from script
"%~dp0PapyrusCompiler" %1 -f="Institute_Papyrus_Flags.flg" -i="%~dp0..\Data\Scripts\Source\User;%~dp0..\Data\Scripts\Source\Base;%~dp0..\Data\Scripts\Source\User" -o="%~dp0..\Data\Scripts" -op -r -final
pause

There is one more step and I'm pretty sure it is why your bat file did not work back in 2018.

after you make your macro in Notepad++, pointing to your bat file, you have to find the NotePad++ shortcuts.xml file and add a FILE_NAME and CURRENT_DIRECTORY to it. The shortcuts.xml file could be in several different places depending on your Windows version. Mine is at: C:\Users\[username]\AppData\Roaming\Notepad++ It could also be at: C:\Documents and Settings\[username]\Application Data\Notepad++\shortcuts.xml If you search around your User folders it shouldn't be too hard to find. Warning: there is a shortcuts.xml in your Notepad++ install folder, It's not the one you want.

 

When you find shortcuts.xml you should have a line that looks something like this:

 <Command name="FO4 Compile Debug" Ctrl="no" Alt="no" Shift="no" Key="0">"C:\Steam\SteamApps\common\Fallout 4\Papyrus Compiler\ScriptCompileDebugDH.bat"</Command>

With the line in the xml as it is above I get the exact same error you did back in 2018 "Failed on -f=Institute_Papyrus_Flags.flg" You need to add:

"$(FILE_NAME)" "$(CURRENT_DIRECTORY)" to the end of that line so it reads as:

        <Command name="FO4 Compile Debug" Ctrl="no" Alt="no" Shift="no" Key="0">"C:\Steam\SteamApps\common\Fallout 4\Papyrus Compiler\ScriptCompileDebugDH.bat" "$(FILE_NAME)" "$(CURRENT_DIRECTORY)"<</Command>

After I got my debugCompile.bat and my finalCompile.bat working I went back and looked at your bat file. It works great too once FILE_NAME CURRENT_DIRECTORY is added to the end of the xml line in the config.xml file. The only change I made to your bat file was the path at the top, and the line at the bottom:

 

Your Original:

"%F4Compile%" %1 -f="Institute_Papyrus_Flags.flg" -i="%F4INCLUDE%" -o="%F4HOME%\Data\Scripts\Source\Base"

Your original -o="%F4HOME%\Data\Scripts\Source\Base" line put the pex output file n your Source/Base folder.

Changed to:

"%F4Compile%" %1 -f="Institute_Papyrus_Flags.flg" -i="%F4INCLUDE%" -o="%F4HOME%\Data\Scripts

The pex output goes into Data\Scripts.

 

I'll probably end up using your bat file, It's much cleaner and easier to read than mine is.

Your Final Release bat file, working on my system:

echo off
:: ---------------------------------------------
:: NotePad++ Run:
::   "D:\Steam\steamapps\common\Fallout 4\Papyrus Compiler\NppScriptCompile_debug.bat" "$(FULL_CURRENT_PATH)"
:: ---------------------------------------------
 
set "F4HOME=C:\Steam\SteamApps\common\Fallout 4
set "F4Compile=%F4HOME%\Papyrus Compiler\PapyrusCompiler.exe"
set "F4SRC=%F4HOME%\Data\Scripts\Source"

:: ---------------------------------------------
:: INCLUDES
:: ---------------------------------------------
 
set "F4INCLUDE=%F4SRC%\Base"
if exist "%F4SRC%\DLC01" set "F4INCLUDE=%F4SRC%\DLC01;%F4INCLUDE%"
if exist "%F4SRC%\DLC02" set "F4INCLUDE=%F4SRC%\DLC02;%F4INCLUDE%"
if exist "%F4SRC%\DLC03" set "F4INCLUDE=%F4SRC%\DLC03;%F4INCLUDE%"
if exist "%F4SRC%\DLC04" set "F4INCLUDE=%F4SRC%\DLC04;%F4INCLUDE%"
if exist "%F4SRC%\DLC05" set "F4INCLUDE=%F4SRC%\DLC05;%F4INCLUDE%"
 
set "F4INCLUDE=%F4SRC%\User;%F4INCLUDE%"
if exist "%F4SRC%\User\Fragments" set "F4INCLUDE=%F4SRC%\User\Fragments;%F4INCLUDE%"
if exist "%F4SRC%\User\Fragments\Quests" set "F4INCLUDE=%F4SRC%\User\Fragments\Quests;%F4INCLUDE%"
if exist "%F4SRC%\User\Fragments\Terminals" set "F4INCLUDE=%F4SRC%\User\Fragments\Terminals;%F4INCLUDE%"

:: ---------------------------------------------
:: DEBUG
:: ---------------------------------------------
echo "====> DEBUG BUILD"
"%F4Compile%" %1 -f="Institute_Papyrus_Flags.flg" -i="%F4INCLUDE%" -o="%F4HOME%\Data\Scripts" -op -r -final
 
pause

Your Debug bat file, working on my system:

echo off
:: ---------------------------------------------
:: NotePad++ Run:
::   "D:\Steam\steamapps\common\Fallout 4\Papyrus Compiler\NppScriptCompile_debug.bat" "$(FULL_CURRENT_PATH)"
:: ---------------------------------------------
 
set "F4HOME=C:\Steam\SteamApps\common\Fallout 4
set "F4Compile=%F4HOME%\Papyrus Compiler\PapyrusCompiler.exe"
set "F4SRC=%F4HOME%\Data\Scripts\Source"

:: ---------------------------------------------
:: INCLUDES
:: ---------------------------------------------
 
set "F4INCLUDE=%F4SRC%\Base"
if exist "%F4SRC%\DLC01" set "F4INCLUDE=%F4SRC%\DLC01;%F4INCLUDE%"
if exist "%F4SRC%\DLC02" set "F4INCLUDE=%F4SRC%\DLC02;%F4INCLUDE%"
if exist "%F4SRC%\DLC03" set "F4INCLUDE=%F4SRC%\DLC03;%F4INCLUDE%"
if exist "%F4SRC%\DLC04" set "F4INCLUDE=%F4SRC%\DLC04;%F4INCLUDE%"
if exist "%F4SRC%\DLC05" set "F4INCLUDE=%F4SRC%\DLC05;%F4INCLUDE%"
 
set "F4INCLUDE=%F4SRC%\User;%F4INCLUDE%"
if exist "%F4SRC%\User\Fragments" set "F4INCLUDE=%F4SRC%\User\Fragments;%F4INCLUDE%"
if exist "%F4SRC%\User\Fragments\Quests" set "F4INCLUDE=%F4SRC%\User\Fragments\Quests;%F4INCLUDE%"
if exist "%F4SRC%\User\Fragments\Terminals" set "F4INCLUDE=%F4SRC%\User\Fragments\Terminals;%F4INCLUDE%"

:: ---------------------------------------------
:: DEBUG
:: ---------------------------------------------
echo "====> DEBUG BUILD"
"%F4Compile%" %1 -f="Institute_Papyrus_Flags.flg" -i="%F4INCLUDE%" -o="%F4HOME%\Data\Scripts"
 
pause

I've messed with these a good bit and the only problem I've ran into so far is I have not been able to get it to compile a Quest Fragment script. That's just not a big deal to me as they are normally piece mealed together anyway.

One other potential problem is Notepad++ version. I'm using an old version, 7.0 I think.

Edited by Pelgar
Link to comment
Share on other sites

  • Recently Browsing   0 members

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