Add Papyrus build and staging

Compile active Papyrus scripts during build and deploy flows, stage compiled `.pex` and source `.psc` files into the mod package, and update setup/dev docs plus changelog for the new workflow.
This commit is contained in:
2026-06-28 22:09:00 +12:00
parent 37d6afbd5a
commit aefeb8b51f
9 changed files with 209 additions and 6 deletions
+41
View File
@@ -9,6 +9,47 @@ failed experiments, successful tests, and next steps.
---
## 2026-06-28 - Papyrus Build Integration
### Summary
Added Papyrus compilation to the full build flow so active source scripts in `creation-kit/scripts/source` are compiled before the mod package is staged.
### Files Changed
- `compile-papyrus.bat`
- `build-all.bat`
- `deploy-all.bat`
- `stage-mod.bat`
- `docs/setup.md`
- `changelog.md`
- `docs/dev-log.md`
### Details
- Added `compile-papyrus.bat`, which resolves Fallout 4 through `resolve-fallout4-path.bat` so build-time Papyrus compilation uses the same explicit path, `FALLOUT4_PATH`, saved `.fallout4-path`, common-path scan, prompt, and save behavior as deploy. Saved `.fallout4-path` values are passed directly to the resolver during builds so `build-all.bat` does not pause for repeat confirmation.
- The compile step calls `PapyrusCompiler.exe` directly instead of `ScriptCompile.bat` because the helper batch uses stale hardcoded `C:\Projects\Fallout4\...` paths.
- `build-all.bat` now compiles active Papyrus scripts before `stage-mod.bat` copies `.pex` files into `build/Fallout 4/Data/Scripts`, and still stages the repo build folder for inspection if Papyrus compilation fails.
- `deploy-all.bat` now resolves the Fallout 4 install path first, compiles Papyrus scripts, stages into the repo build folder, and then copies from `build/Fallout 4/Data` into the game `Data` folder.
- `stage-mod.bat` now preserves relative script paths when staging `.pex` files to `Data/Scripts` and `.psc` files to `Data/Scripts/Source/User`.
- Reference-only `CoSync*.psc` and stale `CoSync*.pex` files are skipped so the old exploration pathway is not included in builds or deploys.
### Testing
- Ran `compile-papyrus.bat "d:\SteamLibrary\steamapps\common\Fallout 4"`.
- Confirmed `CO_Vault109StartQuestScript` compiled successfully.
- Confirmed `CoSync`, `CoSyncPlayer`, and `CoSyncQuest` are skipped as reference-only sources.
- Confirmed `test.psc` is not skipped by name and is treated as an active test script.
- Full `build-all.bat` and `deploy-all.bat` were not run in this session.
- Verified the build-only staging path by running `stage-mod.bat` after a known `test.psc` compile failure.
- Confirmed `build/Fallout 4/Data/Scripts/CO_Vault109StartQuestScript.pex`, `build/Fallout 4/Data/Scripts/Source/User/CO_Vault109StartQuestScript.psc`, and `build/Fallout 4/Data/Scripts/Source/User/test.psc` exist.
- Confirmed `test.psc` was not copied into the real Fallout 4 install during build-only staging.
### Known Issues
- Invalid active `.psc` scripts fail the build, including test scripts whose filename does not match their `Scriptname`.
### Next Steps
- Run `build-all.bat` and confirm the staged package contains `Data/Scripts/*.pex` and `Data/Scripts/Source/User/*.psc`.
- Run `deploy-all.bat` and verify the files land in the Fallout 4 install.
---
## 2026-06-26 - First-Time Join Starts in `COVault109`
### Summary
+15 -3
View File
@@ -4,7 +4,7 @@
- Fallout 4 on PC
- Fallout 4 Script Extender, F4SE
- Fallout 4 Creation Kit
- Fallout 4 Creation Kit, including the Papyrus compiler
- Visual Studio 2022 or newer
- Git
- CMake or another build system required by the selected plugin template
@@ -68,7 +68,13 @@ From the repository root:
build-all.bat
```
This builds the plugin, PrismaUI_F4, and stages a complete mod package into `build/Fallout 4/Data` at the repo root. The layout mirrors the real game path under your Fallout 4 install.
This builds the plugin, PrismaUI_F4, compiles active Papyrus sources from `creation-kit/scripts/source` into `creation-kit/scripts/compiled`, and stages a complete mod package into `build/Fallout 4/Data` at the repo root. The build step does not copy files into the real Fallout 4 install. Reference-only `CoSync*.psc` files are skipped. If a Papyrus script fails to compile, `build-all.bat` still stages the repo build folder for inspection, then exits with an error so the failed script is not missed.
`build-all.bat` uses the same Fallout 4 path resolver as `deploy-all.bat`: it accepts an explicit path, checks `FALLOUT4_PATH`, uses the saved `.fallout4-path`, checks common Steam install paths, and prompts/saves the path when needed. You can also pass the game path explicitly:
```bat
build-all.bat "D:\SteamLibrary\steamapps\common\Fallout 4"
```
```text
build/
@@ -83,6 +89,11 @@ build/
├─ Materials/ (from creation-kit/assets)
├─ Meshes/ (from creation-kit/assets)
├─ Textures/ (from creation-kit/assets)
├─ Scripts/
│ ├─ *.pex (compiled from creation-kit/scripts/source)
│ └─ Source/
│ └─ User/
│ └─ *.psc (from creation-kit/scripts/source)
└─ PrismaUI_F4/
├─ libs/ (Ultralight runtime DLLs)
├─ resources/ (Ultralight assets)
@@ -103,13 +114,14 @@ deploy-all.bat
deploy-all.bat "D:\SteamLibrary\steamapps\common\Fallout 4"
```
`deploy-all.bat` re-stages `build/Fallout 4/Data` then copies it into the game's `Data` folder. On first use it prompts for the install path and saves it in `.fallout4-path` (gitignored).
`deploy-all.bat` resolves the Fallout 4 install path, compiles Papyrus scripts, re-stages `build/Fallout 4/Data`, then copies that staged repo build into the game's `Data` folder. On first use it prompts for the install path and saves it in `.fallout4-path` (gitignored).
Individual steps:
```bat
build.bat REM CommonwealthOnline.dll only
build-prismaui.bat REM PrismaUI_F4.dll only
compile-papyrus.bat REM Papyrus .psc to .pex only
stage-mod.bat REM assemble build/ from existing DLL outputs
deploy-ui.bat REM HTML views only (requires PrismaUI_F4 installed separately)
```