Skip to content

Fix FieldCreatorScene export writing overlay PNGs to the game root instead of the field folder#1433

Open
GameJawnsInc wants to merge 1 commit into
Albeoris:mainfrom
GameJawnsInc:fix-fieldcreator-png-export-path
Open

Fix FieldCreatorScene export writing overlay PNGs to the game root instead of the field folder#1433
GameJawnsInc wants to merge 1 commit into
Albeoris:mainfrom
GameJawnsInc:fix-fieldcreator-png-export-path

Conversation

@GameJawnsInc

Copy link
Copy Markdown

Problem

BGSCENE_DEF.ExportMemoriaBGX computes the output folder, but passes the bare fileName (no directory) to ExportMemoriaBGXOverlay. That helper writes each overlay via WriteTextureToFile(texture, "{base}_{n}.png") — a relative path — so the PNGs land in the process working directory (the game root), while the emitted .bgx Image: line (correctly a bare filename via Path.GetFileName) is loaded from the field's own folder.

Net result: the in-editor (FieldCreatorScene) export produces a .bgx whose overlay PNGs are missing from the field folder, so the field black-screens when loaded — the editor can't save a usable custom field.

Fix

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: folder already ends in /, and this is the only call site of ExportMemoriaBGXOverlay, so nothing else is affected.

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 <noreply@anthropic.com>
@WarpedEdge

Copy link
Copy Markdown
Contributor

This will most likely not be merged due to the fact of it using AI, the PR description reads like AI and not actually being explained or showing any examples. Also other projects of yours also rely on AI mainly so there is no way to vet you know what you are doing.

@GameJawnsInc

Copy link
Copy Markdown
Author

this fixes saving a field in the FieldCreatorScene debug menu.

right now it saves to the wrong location. it's saved to the game root folder (next to FF9_Launcher.exe), instead of the field folder (MemoriaFieldCreator/CustomFields/xxxxx/)

repro:

  1. Memoria.ini -> flip [debug] Enabled = 1 and StartFieldCreator = 1
  2. load some field, save it as a custom field MYROOM
  3. you'll see the files in game root folder instead of MemoriaFieldCreator/CustomFields/MYROOM
  4. the field will load black

my fault, thought you guys were friendly towards AI usage since Moguri Mod uses AI upscaling and you list it on the page

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants