Jump to content

What compiler options exist for Papyrus scripts other than Creation Kit?


Recommended Posts

Well, there's caprica: https://github.com/Orvid/Caprica

 

But I suspect you're referring to the IDE rather than the compiler, perhaps?

If so, you can use Visual Studio Code with the PapyrusLang plugin. It has Intellisense for Papyrus and even offers live debugging of scripts within the running game, you can set breakpoints and inspect variables and such.

 

I recently converted from Notepad++ to this. It's really sleek, even tho sometimes a little bit rough around some edges.

 

Re the actual Papyrus compiler from CK, I'd suggest applying the struct patch. It'll allow you to nest structs within structs - really, really useful.

Link to comment
Share on other sites

Why not just compile direct from Notepad++ ?

 

Run Command menu

Run

Paste in your compiler batch file like C:\Program Files (x86)\Steam\steamapps\common\Fallout 4\Papyrus Compiler\ScriptCompile.Bat

Save

Link to comment
Share on other sites

There is Pyro too, which in integrated into the PapyrusLang VS Code extension. https://github.com/fireundubh/pyro

 

> Paste in your compiler batch file like C:\Program Files (x86)\Steam\steamapps\common\Fallout 4\Papyrus Compiler\ScriptCompile.Bat
That would be the same one included with the Creation Kit and he is already scripting outside the CK.

 

If OP is opening the CK just to compile a script then learning of the PapyrusCompiler.exe works is a good place to start.

https://www.creationkit.com/fallout4/index.php?title=Papyrus_Compiler

Link to comment
Share on other sites

Thank you for all of the quick responses. I will take a look though the options.

 

 

Why not just compile direct from Notepad++ ?

 

Run Command menu

Run

Paste in your compiler batch file like C:\Program Files (x86)\Steam\steamapps\common\Fallout 4\Papyrus Compiler\ScriptCompile.Bat

Save

I have the same path to that batch file but when I run it, I get a file not found error.

 

 

Link to comment
Share on other sites

 

Best to open the BAT file and check each path is correct for your system.
Probaby missing your working script file directory from the -i include path.

 

Wow, every single path was wrong in my BAT file. I corrected them and added my folder address so the compiler knows what files to compile. However, I must be doing something wrong because I keep getting an error when I try to run the BAT.

 

This is my new BAT file.

 

"C:\Program Files (x86)\Steam\steamapps\common\Fallout 4\Papyrus Compiler\PapyrusCompiler.exe" %1 -all="C:\Program Files (x86)\Steam\steamapps\common\Fallout 4\Data\Scripts\Source\User\GrimGrim31" -f="C:\Program Files (x86)\Steam\steamapps\common\Fallout 4\Data\Scripts\Source\Base\Institute_Papyrus_Flags.flg" -i="C:\Program Files (x86)\Steam\steamapps\common\Fallout 4\Data\Scripts\Source" -o="C:\Program Files (x86)\Steam\steamapps\common\Fallout 4\Data\Scripts\GrimGrim31"
pause
It is unhappy with -all="C:\Program Files (x86)\Steam\steamapps\common\Fallout 4\Data\Scripts\Source\User\GrimGrim31" as the folder address where my .PSC files are located that need to be compiled.
The error message says <unknown>(0,0): unable to locate script -all=C::Program Files (x86):Steam:steamapps:common:Fallout 4:Data:Scripts:Source:User:GrimGrim31
Have I given it the wrong form so that it is looking for a single file to compile instead of a folder full of files?
Link to comment
Share on other sites

I got bored trying to get unique folders and namespaces working in a *maintainable* fashion so just use the defaults for simplicity because low patience levels. Maybe get that working before adding cleverness ?

 

Broken down by category for clarity, need to concatinate back into one massive line:

 

 

 

"C:\Program Files (x86)\Steam\steamapps\common\Fallout 4\Papyrus Compiler\PapyrusCompiler.exe" %1

-f=
"C:\Program Files (x86)\Steam\steamapps\common\Fallout 4\Data\Scripts\Source\Base\Institute_Papyrus_Flags.flg"

-i=
"C:\Program Files (x86)\Steam\steamapps\common\Fallout 4\Data\Scripts\Source\Base;
C:\Program Files (x86)\Steam\steamapps\common\Fallout 4\Data\Scripts\Source\User"

-o=
"C:\Program Files (x86)\Steam\steamapps\common\Fallout 4\Data\Scripts" 

 

 

Link to comment
Share on other sites

I got bored trying to get unique folders and namespaces working in a *maintainable* fashion so just use the defaults for simplicity because low patience levels. Maybe get that working before adding cleverness ?

 

Broken down by category for clarity, need to concatinate back into one massive line:

 

 

 

"C:\Program Files (x86)\Steam\steamapps\common\Fallout 4\Papyrus Compiler\PapyrusCompiler.exe" %1

-f=
"C:\Program Files (x86)\Steam\steamapps\common\Fallout 4\Data\Scripts\Source\Base\Institute_Papyrus_Flags.flg"

-i=
"C:\Program Files (x86)\Steam\steamapps\common\Fallout 4\Data\Scripts\Source\Base;
C:\Program Files (x86)\Steam\steamapps\common\Fallout 4\Data\Scripts\Source\User"

-o=
"C:\Program Files (x86)\Steam\steamapps\common\Fallout 4\Data\Scripts" 

 

 

The problem with your BAT is that it has no direction to the compiler to tell it what file or folder of files to compile. scrivener07 posted the link to the CK page and it said, "The very first thing you pass to the compiler is the name of the script (or folder, if you're using the -all flag) to compile." So the 2nd string in the BAT (after the Compiler.exe string) has to have the path to the file or folder to compile. If not, the compiler tries to compile whatever is in the 2nd string which would be the -f= string in your example. That is what happens when I try to use your recommended BAT.

 

I discovered that the -all tag has to follow the 2nd string. I was putting it in front.

 

"C:\Program Files (x86)\Steam\steamapps\common\Fallout 4\Papyrus Compiler\PapyrusCompiler.exe" %1

 

"C:\Program Files (x86)\Steam\steamapps\common\Fallout 4\Data\Scripts\Source\User\GrimGrim31" -all

 

-f="C:\Program Files (x86)\Steam\steamapps\common\Fallout 4\Data\Scripts\Source\Base\Institute_Papyrus_Flags.flg"

 

-i="C:\Program Files (x86)\Steam\steamapps\common\Fallout 4\Data\Scripts\Source\Base; C:\Program Files (x86)\Steam\steamapps\common\Fallout 4\Data\Scripts\Source"

 

-o="C:\Program Files (x86)\Steam\steamapps\common\Fallout 4\Data\Scripts"

pause

 

 

 

Now the compiler will run and begin compiling the nine PSC files that I have in my folder. However, after the screen shows "Starting 9 compile threads for 9 files" followed by a list of the files, it says "<unknown>(0,0) unable to locate script "scriptname" and then "no output generated for "scriptname.psc", compilation failed. I don't know why it cannot find the scripts.

 

I also tried pointing the compiler to the User folder instead of my specific folder. That resulted in 837 PSC files getting compiled including mine. While successful, it takes longer to compile that many files than it does to simply open CK and use the compiler there.

Link to comment
Share on other sites

That file works. On multiple systems. For multiple users. If using default install paths. If using F4SE ofcourse add that include. And any other dependent script paths if your getting complicated.

 

%1 represents the pased in file name, just add the line echo %1 and then pause at the top of the file to see that.

 

 

 

**********************************************
Papyrus debug compiler passed in parameter is:
"SKK_COVIDQuestScript.psc"
**********************************************
Papyrus Compiler Version 2.8.0.4 for Fallout 4
Copyright © ZeniMax Media. All rights reserved.
Starting 1 compile threads for 1 files...
Compiling "SKK_COVIDQuestScript.psc"...
Compilation succeeded.
Batch compile of 1 files finished. 1 succeeded, 0 failed.
Press any key to continue . . .

 

-i is where it looks to find the %1 passed in PSC and dependencies like F4SE

 

-o is where it puts the compiled PEX

 

It really is just that simple.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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