Funkin icon indicating copy to clipboard operation
Funkin copied to clipboard

Enhancement: A generalized Script class

Open nebulazorua opened this issue 2 months ago • 0 comments

Please check for duplicates or similar issues before creating this issue.

What is your suggestion, and why should it be implemented?

As it stands, you can only load 1 script per stage, song, character, etc. I think it'd be beneficial to have a generic Script class that you can extend, which won't load by default but can be loaded by other scripts for organizational purposes. Pretty much a Module that you can load and unload at will. The main use-case would be for loading multiple scripts on songs, calling the callbacks through the main song script or through adding it to some sort of system that automatically dispatches events during dispatchEvent

A less generalized approach would be a GameplayModule or something to that effect, which'd load on every PlayState and unload when PlayState is destroyed, to allow players the same goal of running multiple scripts, though this time only in PlayState. GameplayModule might have its own merits existing alongside Script, though, for stuff like HUD scripts, as right now doing stuff like that in Modules is a pain in the ass and is prone to many, many errors.

nebulazorua avatar May 08 '24 13:05 nebulazorua