Jump to content

High volume Papyrus realease script compile workflow


Recommended Posts

have nearly a THOUSAND papyrus scripts published and regularly updated them with fixes and enhancements.


To help with the publishing workflow I have a custom papyrus release compiler script which in toto is specific to me, but you may find concepts and components useful.


The standards are:


(1) All non fragmentary scripts start with the prefix SKK_MODUNIQUECODE so (a) scripts will never version conflict between solutions (b) I can compile only the scripts relevant to a specific mod © when archives are created I can check that no other scripts have somehow been tagged to include.


(2) Any lines of debug or test code has the postfix ;debugdebug to detect and remedy before release (of course just use DebugOnly pragma for whole functions).


(3) Some of my diagnostic mods actually depend on Debug.Trace output so those specific scripts have to be recompiled as exceptions with debug enabled.


(4) One of my solutions actually hacks three base game scripts (yeah pure filth) so they need to be specifically compiled.


The variable pathing supports script namespaces, although I do not use them to keep things simple.


Enjoy !






@cls
@echo off


echo ********************************
echo Comple scripts for RELEASE
echo -optimize -release -final
echo *********************************
echo.


:INPUT
set /p KEYWORD="Fallout4 script prefix: "
If [%KEYWORD%]==[] goto END
set SOURCEPATH=C:\Program Files (x86)\Steam\steamapps\common\Fallout 4\Data\Scripts\Source\User
cd "%SOURCEPATH%"
echo.
echo ******************************
echo.


:DEBUGDEBUG
del /q debugdebugoutput.txt
FOR %%f in ("%SOURCEPATH%\%KEYWORD%*.psc") DO findstr /i /c:"debugdebug" %%~nf.psc >> debugdebugoutput.txt
if not exist debugdebugoutput.txt goto COMPILE
for /f %%i in ("debugdebugoutput.txt") do set size=%%~zi
echo debugdebugoutput.txt size:%size%
if "%size%"=="0" GOTO COMPILE
start notepad.exe debugdebugoutput.txt
pause
echo.
echo ******************************
echo.


:COMPILE
set FLAGS=C:\Program Files (x86)\Steam\steamapps\common\Fallout 4\Data\Scripts\Source\Base\Institute_Papyrus_Flags.flg
set COMPILERPATH=C:\Program Files (x86)\Steam\steamapps\common\Fallout 4\Papyrus Compiler
set IMPORT1=C:\Program Files (x86)\Steam\steamapps\common\Fallout 4\Data\Scripts\Source\User
set IMPORT2=C:\Program Files (x86)\Steam\steamapps\common\Fallout 4\Data\Scripts\Source\Base
set IMPORT3=C:\Program Files (x86)\Steam\steamapps\common\Fallout 4\Data\Scripts\Source\F4SE
set OUTPUT=C:\Program Files (x86)\Steam\steamapps\common\Fallout 4\Data\Scripts
FOR %%f in ("%SOURCEPATH%\%KEYWORD%*.psc") DO "%COMPILERPATH%\PapyrusCompiler.exe" %%~nf.psc -f="%FLAGS%" -i="%IMPORT1%;%IMPORT2%;%IMPORT3%" -o="%OUTPUT%" -optimize -release -final


If /i [%KEYWORD%]==[SKK_476] goto SKK_476
If /i [%KEYWORD%]==[SKK_WU] goto SKK_WU
If /i [%KEYWORD%]==[SKK_CSET] goto SKK_CSET
If /i [%KEYWORD%]==[SKK_COVID] goto SKK_COVID
If /i [%KEYWORD%]==[SKK_HW] goto SKK_HW
If /i [%KEYWORD%]==[SKK_SP] goto SKK_SP
goto END


:SKK_476
set FILENAME=SKK_476UtilityQuestScript.psc
"%COMPILERPATH%\PapyrusCompiler.exe" %FILENAME% -f="%FLAGS%" -i="%IMPORT1%;%IMPORT2%;%IMPORT3%" -o="%OUTPUT%" -optimize
goto END


:SKK_WU
set FILENAME=SKK_WUTestWorkshopListScript.psc
"%COMPILERPATH%\PapyrusCompiler.exe" %FILENAME% -f="%FLAGS%" -i="%IMPORT1%;%IMPORT2%" -o="%OUTPUT%" -optimize
set FILENAME=SKK_WUTestWorkshopKeywordsScript.psc
"%COMPILERPATH%\PapyrusCompiler.exe" %FILENAME% -f="%FLAGS%" -i="%IMPORT1%;%IMPORT2%" -o="%OUTPUT%" -optimize
set FILENAME=SKK_WUTestWorkshopResourcesScript.psc
"%COMPILERPATH%\PapyrusCompiler.exe" %FILENAME% -f="%FLAGS%" -i="%IMPORT1%;%IMPORT2%" -o="%OUTPUT%" -optimize
set FILENAME=SKK_WURegisterNewWorkshopScript.psc
"%COMPILERPATH%\PapyrusCompiler.exe" %FILENAME% -f="%FLAGS%" -i="%IMPORT1%;%IMPORT2%" -o="%OUTPUT%" -optimize
goto END


:SKK_CSET
set FILENAME=SKK_CSETDebugScript.psc
"%COMPILERPATH%\PapyrusCompiler.exe" %FILENAME% -f="%FLAGS%" -i="%IMPORT1%;%IMPORT2%;%IMPORT3%" -o="%OUTPUT%" -optimize
goto END


:SKK_COVID
set FILENAME=SKK_COVIDDebugScript.psc
"%COMPILERPATH%\PapyrusCompiler.exe" %FILENAME% -f="%FLAGS%" -i="%IMPORT1%;%IMPORT2%;%IMPORT3%" -o="%OUTPUT%" -optimize
goto END


:SKK_HW
set FILENAME=SKK_HWDebugScript.psc
"%COMPILERPATH%\PapyrusCompiler.exe" %FILENAME% -f="%FLAGS%" -i="%IMPORT1%;%IMPORT2%;%IMPORT3%" -o="%OUTPUT%" -optimize
goto END


:SKK_SP
set FILENAME=MQ101QuestScript.psc
"%COMPILERPATH%\PapyrusCompiler.exe" %FILENAME% -f="%FLAGS%" -i="%IMPORT1%;%IMPORT2%;%IMPORT3%" -o="%OUTPUT%" -optimize -release -final
set FILENAME=InstituteEmergencyRelayButtonScript.psc
"%COMPILERPATH%\PapyrusCompiler.exe" %FILENAME% -f="%FLAGS%" -i="%IMPORT1%;%IMPORT2%;%IMPORT3%" -o="%OUTPUT%" -optimize -release -final
set FILENAME=DN136_ElevatorNewScript.psc
"%COMPILERPATH%\PapyrusCompiler.exe" %FILENAME% -f="%FLAGS%" -i="%IMPORT1%;%IMPORT2%;%IMPORT3%" -o="%OUTPUT%" -optimize -release -final
goto END


:END
echo.
echo ******************************
echo.
pause




Link to comment
Share on other sites

  • Recently Browsing   0 members

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