Skip to content

Instantly share code, notes, and snippets.

@Scrivener07
Last active June 17, 2019 00:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Scrivener07/c070d57d8b96bbe414d6547dfc6c7494 to your computer and use it in GitHub Desktop.
Save Scrivener07/c070d57d8b96bbe414d6547dfc6c7494 to your computer and use it in GitHub Desktop.
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
// Papyrus Compile
// --------------------------------------------
{
"label": "SkyrimSE Compile",
"group": "build",
"presentation": {
"reveal": "always",
"panel": "dedicated",
"clear": true
},
"type": "shell",
"command": "Tools\\VSCode\\Compile.bat",
"options":
{
"cwd": "${config:papyrus.skyrimSpecialEdition.installPath}"
},
"args": [
{
"value": "${config:papyrus.skyrimSpecialEdition.installPath}",
"quoting": "strong"
},
{
"value": "CreationKitCustom.ini",
"quoting": "strong"
}
],
"problemMatcher": []
},
// Tools
// --------------------------------------------
{
"label": "SkyrimSE: Start",
"type": "process",
"command": "${config:papyrus.skyrimSpecialEdition.installPath}\\SkyrimSE.exe",
"problemMatcher": []
},
{
"label": "SkyrimSE: Start (xSE)",
"type": "process",
"command": "${config:papyrus.skyrimSpecialEdition.installPath}\\skse64_loader.exe",
"problemMatcher": []
},
{
"label": "SkyrimSE: Creation Kit",
"type": "process",
"command": "${config:papyrus.skyrimSpecialEdition.installPath}\\CreationKit.exe",
"problemMatcher": []
},
{
"label": "SkyrimSE: Creation Kit Archive",
"type": "process",
"command": "${config:papyrus.skyrimSpecialEdition.installPath}\\Tools\\Archive\\Archive.exe",
"problemMatcher": []
},
{
"label": "SkyrimSE: xEdit",
"type": "process",
"command": "${config:papyrus.skyrimSpecialEdition.installPath}\\Tools\\xEdit\\SSEEdit.exe",
"problemMatcher": []
},
{
"label": "SkyrimSE: xEdit (64)",
"type": "process",
"command": "${config:papyrus.skyrimSpecialEdition.installPath}\\Tools\\xEdit\\SSEEdit64.exe",
"problemMatcher": []
},
]
}
[General]
bAllowMultipleMasterLoads=1
[Papyrus]
sScriptSourceFolder = ".\Data\Scripts\Source\MyFolder"
sAdditionalImports = "$(source);.\Data\Scripts\Source\SKSE;.\Data\Scripts\Source\Base"
E:\Games\Steam\steamapps\common\Skyrim Special Edition\Data\Scripts
\---Source
+---Base
+---MyFolder
\---SKSE
> Executing task in folder Skyrim Special Edition: Tools\VSCode\Compile.bat "E:\Games\Steam\steamapps\common\Skyrim Special Edition" "CreationKitCustom.ini" <
Compile.bat
----------------------------------------------------------------------
The data file to use.
FileName: CreationKitCustom.ini
The Creation Kit initialization file to use.
FilePath: E:\Games\Steam\steamapps\common\Skyrim Special Edition\CreationKitCustom.ini
The Papyrus Compiler executable to use.
PapyrusCompiler: E:\Games\Steam\steamapps\common\Skyrim Special Edition\Papyrus Compiler\PapyrusCompiler.exe
----------------------------------------------------------------------
Environment variable ImportResult not defined
SourceExtracted: .\Data\Scripts\Source\MyFolder
'""' is not recognized as an internal or external command,
operable program or batch file.
SourceResult: ""
ImportExtracted: $(source);.\Data\Scripts\Source\SKSE;.\Data\Scripts\Source\Base
The system cannot find the path specified.
ImportResult:
PapyrusCompiler: "E:\Games\Steam\steamapps\common\Skyrim Special Edition\Papyrus Compiler\PapyrusCompiler.exe"
SourceResult: ""
ImportResult: ""
output: "E:\Games\Steam\steamapps\common\Skyrim Special Edition\Scripts"
----------------------------------------------------------------------
Terminal will be reused by tasks, press any key to close it.
@ECHO OFF
ECHO %~nx0
ECHO ----------------------------------------------------------------------
SET Game=%~1
SET FileName=%~2
REM
ECHO The data file to use.
ECHO FileName: %FileName%
ECHO.
SET output="E:\Games\Steam\steamapps\common\Skyrim Special Edition\Scripts"
REM ----------------------------------------------------------------------
ECHO The Creation Kit initialization file to use.
SET "FilePath=%Game%\%FileName%"
ECHO FilePath: %FilePath%
ECHO.
ECHO The Papyrus Compiler executable to use.
SET "PapyrusCompiler=%Game%\Papyrus Compiler\PapyrusCompiler.exe"
ECHO PapyrusCompiler: %PapyrusCompiler%
ECHO.
ECHO ----------------------------------------------------------------------
ECHO.
@SETLOCAL ENABLEEXTENSIONS
@SETLOCAL ENABLEDELAYEDEXPANSION
REM ----------------------------------------------------------------------
SET SourceDepth=31
SET SourceResult=""
REM ----------------------------------------------------------------------
SET ImportDepth=22
SET ImportResult
REM ----------------------------------------------------------------------
FOR /F "usebackq tokens=*" %%A in ("%FilePath%") do (
SET line=%%A
@ECHO !line!|find "sScriptSourceFolder" >nul
IF NOT ERRORLEVEL 1 (
SET source=!line:~-%SourceDepth%!
SET source=!source:^"=!
ECHO SourceExtracted: !source!
%SourceResult%="!source!"
ECHO SourceResult: %SourceResult%
ECHO.
)
@ECHO !line!|find "sAdditionalImports" >nul
IF NOT ERRORLEVEL 1 (
SET import=!line:~%ImportDepth%!
SET import=!import:^"=!
ECHO ImportExtracted: !import!
%ImportResult% = "!import!"
ECHO ImportResult: %ImportResult%
ECHO.
)
)
ENDLOCAL
ECHO.
ECHO PapyrusCompiler: "%PapyrusCompiler%"
ECHO SourceResult: "%SourceResult%"
ECHO ImportResult: "%ImportResult%"
ECHO output: %output%
REM "%PapyrusCompiler%" "%source%" -i="%import%" -o=%output% -f="TESV_Papyrus_Flags.flg" -all
ECHO ----------------------------------------------------------------------
@Scrivener07
Copy link
Author

Scrivener07 commented Jun 16, 2019

These parts are extracting INI values but I fumbled getting the values into a scope I can pass to the compiler.

Source Extracted: .\Data\Scripts\Source\MyFolder
Import Extracted: $(source);.\Data\Scripts\Source\SKSE;.\Data\Scripts\Source\Base

I had trouble getting the extracted values into my the two variables.

SourceResult: ""
ImportResult: ""

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment