Advertisement
DieFeM

Fallout 4 compile from Notepad++

Apr 27th, 2018
895
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 2.04 KB | None | 0 0
  1. @echo off
  2. REM Save this code as C:\Fallout 4\Papyrus Compiler\ScriptCompileCustom.bat
  3. REM In notepad++ click on "Execute..." and paste this command; "C:\Fallout 4\Papyrus Compiler\ScriptCompileCustom.bat" "$(FILE_NAME)" "$(CURRENT_DIRECTORY)"
  4. REM and save it with your preferred key combo, then you can use your combo to start the compilation
  5. setlocal EnableDelayedExpansion
  6. REM Find out the base path for fallout 4, which is the parent folder
  7. for %%I in ("%~dp0\..") do set "BasePath=%%~fI"
  8. REM Find out the partition, windows needs to change to the partition before changing the directory
  9. for /F "tokens=1 delims=\" %%a in ("%BasePath%") do set Partition=%%a
  10. REM Stores the full path to the source script
  11. set Path_to_convert=%2
  12. REM remove quotes
  13. set Path_to_convert=%Path_to_convert:"=%
  14. REM Stores the full path for user scripts
  15. set Reference_path=%BasePath%\Data\Scripts\Source\User
  16. REM Change to the Fallout 4 partition
  17. %Partition%
  18. REM change directory to the scripts source folder
  19. cd "!Reference_path!"
  20. REM If the script folder is the base folder then pass the script name only, otherwise pass the relative path to the source script
  21. If !Path_to_convert! == !Reference_path! (
  22.     REM call the compiler using the name of the script since it is in the root of the User folder
  23.     "%BasePath%\Papyrus compiler\PapyrusCompiler.exe" %1 -f="Institute_Papyrus_Flags.flg" -i="%BasePath%\Data\Scripts\Source\Base" -o="%BasePath%\Data\Scripts"
  24. ) ELSE (
  25.     REM Gets the relative path of the current script folder
  26.     set RelativePath=!Path_to_convert:*%Reference_path%\=!
  27.     REM remove quotes
  28.     set RelativePath=!RelativePath:"=!
  29.     REM store the file name
  30.     set file=%1
  31.     REM Remove quotes
  32.     set file=!file:"=!
  33.     REM stores the relative path to the script
  34.     set RelativePath="!RelativePath!\!file!"
  35.     REM call the compiler using the relative path of the script
  36.     "%BasePath%\Papyrus compiler\PapyrusCompiler.exe" !RelativePath! -f="Institute_Papyrus_Flags.flg" -i="%BasePath%\Data\scripts\Source\Base" -o="%BasePath%\Data\scripts"
  37. )
  38. REM shows "Press any key to continue..."
  39. pause
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement