Alexofp / BDCC

Text based game about being a prisoner in a space prison with a lot of adult themes. Working title is Broken Dreams Correctional Center or BDCC for short. Test the latest version here: (could be unstable)
https://alexofp.github.io/BDCC/
MIT License
147 stars 48 forks source link

ModularDialogue Registers too early #116

Open Mindstormsman opened 1 month ago

Mindstormsman commented 1 month ago

The new Modular Dialogue system was clearly designed with the intent to allow modders to add their own form banks however because it is an autoload and registers in on ready it has already registered the forms before mods are loaded

The register functions should be delayed until after mod loading

CanInBad commented 1 month ago

I believe you can just do

var listFormsToRegister = ["res://path/to/dialogueform1.gd", "res://path/to/dialogueform2.gd"]

for i in listFormsToRegister:
    var form = load(i).new()
    ModularDialogue.registerForm(form)

same goes for other parts of the modulardialogue as seen here

https://github.com/Alexofp/BDCC/blob/main/Game/ModularDialogue/ModularDialogue.gd#L37-L55

Mindstormsman commented 1 month ago

Closer to

var formBanks = ["res://path/to/formBank1.gd", "res://path/to/formBank2.gd"]

for i in formBanks:
    var bank = load(i).new()
    ModularDialouge.registerFormBank(form)

individual forms have extra data associated with them and this is just for the forms, this code would have to be copied again for fillers and adders

If this is a bug, I'm worried that if we use the work around and the bug is fixed mods will throw an error per line of text they add as forms are attempting to be registered twice

I don't suppose there is a way to close an issue as Don't fix as opposed to Won't fix

CanInBad commented 1 month ago

make a pr to add such in module lol, Module class already does this sort of boilerplate

https://github.com/Alexofp/BDCC/blob/main/Modules/Module.gd#L44-L136

as for the concern, I guess we have to wait for @Alexofp for confirmation if they're going to fix it as you intented it to be or left this one a "feature"