From b3a3ee3639f4cbd43d06dbecb5bca8fc305eb4e8 Mon Sep 17 00:00:00 2001 From: gitea Date: Mon, 30 Nov 2026 00:26:25 +0800 Subject: [PATCH] =?UTF-8?q?=E9=95=9C=E5=83=8F=EF=BC=9AKintaroModding/phant?= =?UTF-8?q?ombladezero=5Fletsdieagain=EF=BC=882026-11-30=EF=BC=8C=E5=BF=AB?= =?UTF-8?q?=E7=85=A7=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitattributes | 7 + .gitignore | 2 + LICENSE | 21 +++ README.md | 75 ++++++++ build.ps1 | 161 ++++++++++++++++++ deploy.ps1 | 152 +++++++++++++++++ docs/cover.webp | Bin 0 -> 241900 bytes docs/screen1.webp | Bin 0 -> 15504 bytes mod.json | 14 ++ openmods.json | 10 ++ openmods.md | 56 ++++++ scripts/bump_version.py | 56 ++++++ .../Localization/Game/en-US/Game.locres | Bin 0 -> 1585956 bytes 13 files changed, 554 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 LICENSE create mode 100644 README.md create mode 100644 build.ps1 create mode 100644 deploy.ps1 create mode 100644 docs/cover.webp create mode 100644 docs/screen1.webp create mode 100644 mod.json create mode 100644 openmods.json create mode 100644 openmods.md create mode 100644 scripts/bump_version.py create mode 100644 src/ProjectPBZ/Content/Localization/Game/en-US/Game.locres diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..53f45cf --- /dev/null +++ b/.gitattributes @@ -0,0 +1,7 @@ +* text=auto eol=lf +*.uasset binary +*.uexp binary +*.pak binary +*.utoc binary +*.ucas binary +*.locres binary diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..2ead01d --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +dist/ +__pycache__/ diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..dd3a73f --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2026 Kintaro + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..2e80eeb --- /dev/null +++ b/README.md @@ -0,0 +1,75 @@ +# Let's Die Again! + +The main menu's CONTINUE entry reads LET'S DIE AGAIN! instead (English text). + +A mod for Phantom Blade Zero (Unreal Engine 5.7), made with game version `CL-301524_JKS-17219`. This README is +for developers. What the mod does, how to install it and its compatibility are in [openmods.md](openmods.md), the mod +page on [openmods](https://openmods.nexus). + +## How it works + +The game keeps its texts in one file per language in its `ProjectPBZ-Windows.pak`. The mod replaces the English one, +`ProjectPBZ/Content/Localization/Game/en-US/Game.locres` (locres version 3, namespace `Default`, 11256 entries in patch 1.0304629), with +a copy in which one text changes: + +| Namespace | Key | Game | Mod | +|---|---|---|---| +| `Default` | `UI_StartMenu_02` | `CONTINUE` | `LET'S DIE AGAIN!` | + +The game's start menu script sets the Continue button's text from this key (`StartMenu.js`, `InitText`). Only this +key changes; its source hash and every other entry stay as they are. The text is in capitals like the other menu +entries (NEW GAME, LOAD GAME, SETTINGS, QUIT GAME). The first commit holds the game's original file; a text dump of +both files (for example with a `.locres` tool) differs in this one line. + +The mod replaces whole files. A mod that changes the same files conflicts with this one, and a game update that +changes them needs a new build of the mod from the new files. + +## Build + +Requirements: + +- Windows PowerShell 5.1 (part of Windows). +- [repak](https://github.com/trumank/repak/releases) v0.2.3 and [retoc](https://github.com/trumank/retoc/releases) + v0.1.5. `build.ps1` looks for `_tools\repak\repak.exe` and `_tools\retoc\retoc.exe` in the parent folders of the + project; set `UE5_TOOLS` to a folder that holds both to use another place. +- Optional, for mods with JavaScript: [Node.js](https://nodejs.org/) for the syntax check and the offline test + (`tests\test_mod.js`). + +```powershell +powershell -ExecutionPolicy Bypass -File .\build.ps1 # dist\phantombladezero_letsdieagain_P.pak/.utoc/.ucas +powershell -ExecutionPolicy Bypass -File .\build.ps1 -Deploy # build, then copy the files to Paks\~mods +powershell -ExecutionPolicy Bypass -File .\deploy.ps1 -Wait # copy the files when the game is closed +``` + +The build checks every `.js` in `src` with `node --check` and runs `tests\test_mod.js` when there is one. Then it +packs `src` into a `.pak` (repak, pak version V11, mount point `../../../`), writes an empty IoStore container of the +same name (retoc `to-zen`; an IoStore game can ignore a `.pak` without one), and checks that the pak holds exactly +the files of `src`, byte for byte. + +`deploy.ps1` copies the three files to `\ProjectPBZ\Content\Paks\~mods`. The game folder comes from `gameDir` in +`_tools\gamedata\phantombladezero\game.json`, else `$env:UE5_GAMES_DIR\PBZ`; `-GameDir` or `-ModsDir` override +it. The running game locks the files, so the script stops (exit code 2) or, with `-Wait`, waits until the game is +closed. + +Versioning: every change raises the second number in `mod.json` (1.0 -> 1.1): `python scripts\bump_version.py`. + +## Project layout + +``` +src/ Mod source: the changed game files at their path in the game's .pak +tests/test_mod.js Offline test of the scripts (Node.js; only for mods with JavaScript) +dist/ Build output: the .pak/.utoc/.ucas for Paks\~mods (git-ignored) +docs/ Cover and screenshots for openmods.md +scripts/bump_version.py Raises the version in mod.json +build.ps1 Checks and builds dist\ from src\ +deploy.ps1 Copies the build to the game's Paks\~mods folder +mod.json Name, version, game, engine and file names +``` + +The first commit with a game file holds the original file, so `git diff` against it shows exactly what the mod +changes. + +## License + +MIT, see [LICENSE](LICENSE). The files in `src` are the game's own files with the changes above; Phantom Blade Zero and +its files belong to their makers. diff --git a/build.ps1 b/build.ps1 new file mode 100644 index 0000000..872335c --- /dev/null +++ b/build.ps1 @@ -0,0 +1,161 @@ +<# +.SYNOPSIS + Builds the mod (the src folder) into dist\.pak/.utoc/.ucas, the files for the game's Paks\~mods folder. + +.DESCRIPTION + The mod changes loose files of the game's classic .pak (for example the game's Puerts JavaScript or its .locres + text files), not .uasset assets. Reads mod.json. Uses repak and retoc from the shared _tools folder of the modding + base folder ($env:UE5_TOOLS overrides it), and Node.js when it is installed: + 1. checks the syntax of every src\**\*.js (node --check) and runs the offline test tests\test_mod.js when the + project has one; without Node.js both are skipped with a warning; + 2. packs src into dist\.pak with repak (pak version V11, mount point ../../../): the files keep their + game path below src, for example src\\Content\JavaScript\UI\Widget\