Fix FieldCreatorScene export writing overlay PNGs to the game root instead of the field folder#1433
Open
GameJawnsInc wants to merge 1 commit into
Open
Conversation
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>
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. |
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:
my fault, thought you guys were friendly towards AI usage since Moguri Mod uses AI upscaling and you list it on the page |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
BGSCENE_DEF.ExportMemoriaBGXcomputes the outputfolder, but passes the barefileName(no directory) toExportMemoriaBGXOverlay. That helper writes each overlay viaWriteTextureToFile(texture, "{base}_{n}.png")— a relative path — so the PNGs land in the process working directory (the game root), while the emitted.bgxImage:line (correctly a bare filename viaPath.GetFileName) is loaded from the field's own folder.Net result: the in-editor (FieldCreatorScene) export produces a
.bgxwhose 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 + fileNameas the texture base path.ExportMemoriaBGXOverlayalready derives theImage:reference withPath.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:
folderalready ends in/, and this is the only call site ofExportMemoriaBGXOverlay, so nothing else is affected.