Jump to content

[WIP] Caprica Papyrus Compiler


Orvid

Recommended Posts

Because I'm not a patient enough person to wait for the Creation Kit to come out, I went and wrote my own Papyrus compiler. Available on the nexus here, it supports what I believe to be the syntax for the new features present in FO4, and, as of v0.0.4 can also disassemble and re-assemble .pex files.

 

The Caprica compiler is also far faster than the CK compiler, as it is able to compile all 2.4k scripts for Fallout 4 in just over 8 seconds on my computer when compiling one file at a time, and 4 seconds when parallel compilation is enabled. (the current releases have parallel compilation disabled, but there will eventually be a command-line option to enable it)

 

Feel free to leave any feedback you have on it here, on the mod page, or on Github.

Link to comment
Share on other sites

  • 2 months later...

You have to use cmd. Best write yourself a small batch file. Here is mine, just edit the paths:

@echo off

set compdirectroy="D:\Modding\Fallout4\Tools\ScriptCompiler"
set srcdirectory="D:\Modding\Fallout4\Data\Scripts\src"
set bindirectory="D:\Modding\Fallout4\Data\Scripts"
set fo4scriptdirectoy="D:\Steam\steamapps\common\Fallout 4\Data\Scripts"

:start
echo Enter filename without extension:
set /p filename=

cd %compdirectroy%
caprica.exe "%srcdirectory%\Custom\%filename%.psc" -i "%bindirectory%" -o "%bindirectory%\Custom" --champollion-compat yes --allow-compiler-identifiers

echo Copy compiled .pex to scripts directory? (y/n)
set /p bCopyToFO4=

if "%bCopyToFO4%" == "y" (
	copy %bindirectory%\Custom\%filename%.pex %fo4scriptdirectoy%
	copy %srcdirectory%\Custom\%filename%.psc %fo4scriptdirectoy%\src\DarthWayne
)
pause
cls
goto start

Edit: This bat compiles only compiles psc files in subfolder named "Custom". It can also cause problems if you have blanks in your paths...

Edited by DarthWayne
Link to comment
Share on other sites

You have to use cmd. Best write yourself a small batch file. Here is mine, just edit the paths:

@echo off

set compdirectroy="D:\Modding\Fallout4\Tools\ScriptCompiler"
set srcdirectory="D:\Modding\Fallout4\Data\Scripts\src"
set bindirectory="D:\Modding\Fallout4\Data\Scripts"
set fo4scriptdirectoy="D:\Steam\steamapps\common\Fallout 4\Data\Scripts"

:start
echo Enter filename without extension:
set /p filename=

cd %compdirectroy%
caprica.exe "%srcdirectory%\Custom\%filename%.psc" -i "%bindirectory%" -o "%bindirectory%\Custom" --champollion-compat yes --allow-compiler-identifiers

echo Copy compiled .pex to scripts directory? (y/n)
set /p bCopyToFO4=

if "%bCopyToFO4%" == "y" (
	copy %bindirectory%\Custom\%filename%.pex %fo4scriptdirectoy%
	copy %srcdirectory%\Custom\%filename%.psc %fo4scriptdirectoy%\src\DarthWayne
)
pause
cls
goto start

Edit: This bat compiles only compiles psc files in subfolder named "Custom". It can also cause problems if you have blanks in your paths...

I've tried to troubleshoot, but it keeps giving me this error

 

Enter filename without extension: QF_MS17_00022A08

Compiling C:\Users\eric\Desktop\psctopex\src\QF_MS17_00022A08.psc
C:\Users\eric\Desktop\psctopex\src\QF_MS17_00022A08.psc(9,51): Error: The script name 'Fragments:Quests:QF_MS17_00022A08' must match the name of the file 'QF_MS17_00022A08'!
Compilation failed, 0 warnings and 1 errors were encountered.

Copy compiled .pex to scripts directory? (y/n)

Here is my batch file

 

 

echo off

set compdirectroy="C:\Users\eric\Desktop\psctopex\"
set srcdirectory="C:\Users\eric\Desktop\psctopex\src"
set bindirectory="C:\Users\eric\Desktop\psctopex\bin"
set fo4scriptdirectory="CC:\Program Files (x86)\Steam\steamapps\common\Fallout 4\Data\scripts"

:start
echo Enter filename without extension: QF_MS17_00022A08
set /p filename=

cd %compdirectroy%
caprica.exe "%srcdirectory%" -i "%bindirectory%" -o "%bindirectory%" --champollion-compat yes --allow-compiler-identifiers

echo Copy compiled .pex to scripts directory? (y/n)
set /p bCopyToFO4=

if "%bCopyToFO4%" == "y" (
	copy %bindirectory%\QF_MS17_00022A08.pex %fo4scriptdirectoy% 
	copy %srcdirectory%\QF_MS17_00022A08 %fo4scriptdirectoy%
)
pause
cls
goto start

What did I do wrong?

Link to comment
Share on other sites

  • Recently Browsing   0 members

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