From 52acac909822958e8603ff8df112e6da9e6db9c0 Mon Sep 17 00:00:00 2001 From: GameJawnsInc <122755272+GameJawnsInc@users.noreply.github.com> Date: Wed, 3 Jun 2026 13:13:02 -0400 Subject: [PATCH] Fix FieldCreatorScene export writing overlay PNGs to the game root ExportMemoriaBGX passes the bare fileName (no directory) to ExportMemoriaBGXOverlay, which writes each overlay via WriteTextureToFile with a relative "{base}_{n}.png" path -- so the PNGs land in the process working directory (the game root), while the emitted .bgx "Image:" line (a bare filename via Path.GetFileName) is loaded from the field's own folder. The overlays are therefore missing from the field folder and the field black-screens when loaded. Pass folder + fileName as the texture base path. ExportMemoriaBGXOverlay already derives the "Image:" reference with Path.GetFileName, so the reference stays bare/relative while the file is written into the field folder. One-line change, scoped to the editor export path. Co-Authored-By: Claude Opus 4.8 --- Assembly-CSharp/Global/BGSCENE_DEF.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Assembly-CSharp/Global/BGSCENE_DEF.cs b/Assembly-CSharp/Global/BGSCENE_DEF.cs index 1e42a31dc..1e109edd5 100644 --- a/Assembly-CSharp/Global/BGSCENE_DEF.cs +++ b/Assembly-CSharp/Global/BGSCENE_DEF.cs @@ -516,7 +516,10 @@ public void ExportMemoriaBGX(String bgxExportPath) foreach (BGOVERLAY_DEF bgOverlay in this.overlayList) { bgsStr += $"OVERLAY\n"; - bgsStr += ExportMemoriaBGXOverlay(bgOverlay, fileName); + // Write overlay PNGs NEXT TO the .bgx, not the process CWD (the game root). + // ExportMemoriaBGXOverlay derives the .bgx "Image:" ref with Path.GetFileName(), + // so it stays bare/relative while the file lands in the field folder. + bgsStr += ExportMemoriaBGXOverlay(bgOverlay, folder + fileName); } foreach (BGANIM_DEF bgAnim in this.animList) {