As a Roblox developer, it is currently too hard to develop plugins.
Reloading plugins stops all running plugin scripts and coroutines completely, removes all plugin buttons/categories, then re-runs installed plugins. Reloading plugins is already implemented and happens any time you install a new plugin.
My favorite solutions to the plugin-development problem are user-written tools such as HotSwap (thread), PlacePlugins, and Run Script (which runs things in a plugin environment).
If there is an error or bug in any of the “plugins” these scripts run, there is no way to stop their scripts and remove their plugin buttons. The only way around this is Run mode, which runs all scripts in game, runs the physics simulation, and disables undo/redo. Not the ideal plugin testing environment. HotSwap uses Run mode.
Ideally…
- HotSwap would have a “Run” button that clears out old buttons and stop scripts from the hotswapped plugin. HotSwap would then run the hotswapped plugin.
- PlacePlugins would have a “Load/Reload” button which clears out old buttons, stops plugin scripts, then runs all PlacePlugins.
- Run Script would have a “Clean” button to stop all scripts and clear out any buttons made by previously-ran scripts.
Plugin:ReloadPlugins()
makes all of this possible in a simple manner using existing functionality.
When :ReloadPlugins()
is called, all plugin code would stop, including the plugin that called :ReloadPlugins()
. If a plugin wants to transfer state across the reload then it needs to save it in the game tree somewhere.
:ReloadPlugins()
is the ideal solution here because it works with the tools I already use and is more flexible than if Roblox implemented the features of just one of the example plugins.
If Roblox is able to address this issue, it would improve my experience using and developing plugins.