Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request]: Store GameSettings.lua addresses as a JSON #497

Open
UTDZac opened this issue Dec 16, 2024 · 0 comments
Open

[Feature Request]: Store GameSettings.lua addresses as a JSON #497

UTDZac opened this issue Dec 16, 2024 · 0 comments
Assignees
Labels
Feature Request A new feature idea

Comments

@UTDZac
Copy link
Collaborator

UTDZac commented Dec 16, 2024

Tell us about your request

Goal of this change

Makes it easier for custom rom hacks to easily provide a list of changed addresses for the Tracker to load up and use.

Process of implementation

Move the hard-coded addresses from GameSettings.lua to JSON files, one file for each support game version (such as Emerald, FireRed v1.0, FireRed v1.1, etc.)

Example custom code extension

Here is a snippet of code showing how a custom code extension uses this concept to replace the used addresses:

self.offsetFiles = {
    [2] = "offsets_em.json",
    [3] = "offsets_fr.json"
}
self.extensionKey = "MAXExtension"
local offsetFile = self.offsetFiles[GS.game] or "offsets.json"
local filePath = FileManager.getCustomFolderPath() .. self.extensionKey .. FileManager.slash .. offsetFile
local off = FileManager.decodeJsonFile(filePath)
--pass the off table into a function that loads everything into the game settings

Example JSON file

Definitely want a bit more structure than this, but here is a loose example

{"gBattleTerrain":33697776,"gBattleStruct":33703068, ... }

Additional Information

No response

@UTDZac UTDZac added the Feature Request A new feature idea label Dec 16, 2024
@UTDZac UTDZac self-assigned this Dec 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Request A new feature idea
Projects
None yet
Development

No branches or pull requests

1 participant