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

modGuid validation as Table / Array in JSON Config #90

Open
RandoRuda opened this issue Dec 5, 2023 · 2 comments
Open

modGuid validation as Table / Array in JSON Config #90

RandoRuda opened this issue Dec 5, 2023 · 2 comments
Labels
Enhancement New feature or request Needs Discussion Extra attention is needed

Comments

@RandoRuda
Copy link
Contributor

RandoRuda commented Dec 5, 2023

Part of #46

As more and more mods are becoming the backbone of people's playthroughs of BG3, being able to check if multiple mods are loaded before attempting to add things to the queue seems necessary.

In order to avoid causing another refactoring issue, I'm wondering what might be the best implementation method.

  1. Use modGuids when requiring multiple mods.

It might not be elegant, but it will work for easier differentiation. It is also a method already used with UUIDs in Progressions.

function ProgressionJsonHandler(data, modGuid)
  Utils.Info("Entering ProgressionJsonHandler")
  for _, progressions in pairs(data) do
    if progressions.UUIDs ~= nil then
      for _, uuid in pairs(progressions.UUIDs) do
        ProgressionSubSectionHandler(progressions, uuid, modGuid)
      end
    elseif progressions.UUID ~= nil then
      ProgressionSubSectionHandler(progressions, progressions.UUID, modGuid)
    end
  end
end
  1. Use type(modGuid) to determine if it is a String or a Table.

I don't have much experience with LUA, but I understand this might be a slow or resource heavy method?


In any case, I am curious where others sit. In addition, I guess making sure I don't start building something that has already been started elsewhere on a local repo.

@RandoRuda RandoRuda added Enhancement New feature or request Needs Discussion Extra attention is needed labels Dec 5, 2023
@NellsRelo
Copy link
Contributor

Thankfully, lua's pretty fast, so that method shouldn't be too unwieldly.

I haven't started on this feature, so feel free to build it out :D

@NellsRelo
Copy link
Contributor

Thinking on it, it may be worth having a parentModGuid field automatically filled out in the JSON loader, to differentiate required mods & the mod providing the changes, to assist in debugging

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New feature or request Needs Discussion Extra attention is needed
Projects
Status: Backlog
Development

No branches or pull requests

2 participants