Plugin Debugging: New Beta Feature!

Flavor Text: Debuggin’ a Plugin

Meet Doug.

Doug is chuggin’ on writing a Plugin. Chug Chug.

Doug has a bug in Doug’s Plugin. Ugh!

Doug enables Plugin Debugging in Beta Features, then sets Plugin Debugging Enabled in Settings. Will it help? He is not sure. shrug.

Doug’s local plugins are now visible under PluginDebugService in Explorer. He can browse source, set breakpoints, watch variables, and examine the callstack like a debugging thug. He can also tweak the code and Save And Reload the plugin to immediately see if his changes fixed the bug.

Doug’s pulled the plug on his plugin bug! Hugs! Now he can get back to drinking from his mug (chug chug) and eating his favorite snack (spicy nuggs).

The Business

Making Plugins is hard! Plugins are extensions of native Studio functionality and work a bit differently than building a game. To make this process easier, Studio now offers the ability to point the Lua debugger at executing Plugin scripts. The debugger is a powerful tool that can quickly hone in on issues, allowing you to fix them with minimum weeping and gnashing of teeth.

Enabling the Plugin Debugger

Beta Feature

The Plugin Debugger is currently supported as a Beta Feature.

To enable: File -> Beta Features -> Plugin Debugging.

You will have to restart Studio.

Settings

Once the Beta Feature is enabled, you have to enable some Settings (since the plugin debugger adds items to the Explorer, and Plugin Debugging is not a common workflow).

To enable: File -> Settings -> <Search on “Debug”>

Set “Plugin Debugging Enabled” and “Lua Debugger Enabled” to true.

You will have to restart Studio again (I know… sorry…)

Plugin Debug Workflow

Create a Local Plugin

Save the Plugin you wish to debug as a local plugin. (The plugin debugger only works on local plugins: not built-in, and not plugins installed from the web).

Debug

In the Explorer window you should see a “PluginDebugService”. Open this to see all of your local plugins.

Note that you are seeing a representation of each plugin as it exists and executes in Studio: these plugins are actively running as you browse them.

You can navigate the contents of the plugins to see and edit the scripts in the plugin, and to set breakpoints.

Once a breakpoint is hit, you can navigate the call stack, add watches to inspect the value of variables, step in/out/over functions, etc.

For more background on using the Lua debugger, see here.

Edit and Reload

You can edit the scripts under the Plugin Debug Service to fix problems as you find them. To test your changes, right click on the Plugin under the Plugin Debug Service and select “Save and Reload Plugin”. This will write your plugin back out to the local plugins directory, unload the old version of the plugin, and reload and execute the new updated plugin.

Warning: If your plugin modifies itself (say by moving scripts around or adding new scripts as it runs), Save and Reload Plugin will cause problems: you are saving out the plugin as it currently exists in memory: you are not saving out the “pristine” version as it was originally loaded.

Thanks

This would not be possible without the tireless efforts of @CycloneUprising, @MetalMax2, @IcyTides, @ResetVector and @sunny0724

Happy debugging!

119 Likes

This topic was automatically opened after 13 minutes.

OMG, are you guys like watching me? :eyes: I’m literally creating a plugin right now…

In all seriousness, you guys are the absolute best! The timing is also appreciated, personally. :clock10: I can’t tell you how hard it is to debug using only print. Sure, it can cover most cases, but not all.

But Plugin Debuggin’ comes to the rescue! :superhero:

Finally, scripts and plugins have equal rights (in terms of debugging, at least).

P.S. It has a nice ring to it. :bell:

Anyways, thank you to everyone who worked on this!
Keep it up, Roblox! :roblox_light: :roblox:

22 Likes

Now I don’t have to manually save the plugin all over again when I make a change :smiley:
Thanks for improving our plugin development workflow, it is REALLY appreciated!

2 Likes

Okay but for real this is nice. Debugging and creating plugins will now be so much easier and so much more efficient. :smiley:
But why must we restart twice? lol.
Anyways, nice, Roblox.

4 Likes

One word: Finally!
Thank you for the update, we really needed it!

2 Likes

Hurrah! My plugin development workflow has been excruciatingly slow due to having to republish after every change, now this’ll definitely speed things up. Thank you!

2 Likes

ALAS!!! Having to reload plugins has been the most painful thing about plugin development and greatly discouraged me from working on them. HOWEVER, now I can finally make plugins easier!

Definitely a step leap in the right direction! I hope to see more QOL updates for plugin development! They are powerful tools developers can use to create amazing games, so it’s very important they get the attention they deserve!

Edit:
I am super excited for this, here is a suggestion to take this feature a step further and making the workflow even smoother!

4 Likes

image

Seriously though, great feature. Plugin development is one of the most criminally under-supported things on Roblox.

20 Likes

Amazing update. It was always so hard for me to debug a plugin that I had, which I ended up throwing away anyways, but that is not the point. It was such a pain to debug it and the only way I could do it was with print statements and other things I could come up with. This update makes it far more easier to debug and I love that. Great job!

1 Like

Finally, I’ve been developing plugins for a while and every error I’ve encountered was either hidden or just something very hard to find on the web since there are very few people who make plugins, this will probably make more people start making plugins.

1 Like

Perfect timing! I was thinking this morning about making a plugin to aid in the development of my game, and this will make it much easier!

Glad to see good improvement from Roblox
:fox_face:

OK whoops. Someone else wrote that part of the post…

10 Likes

Finally. Plugins finally getting some love.

Thank. You.

This is one of if not the most fun/funny announcements I’ve read; Thank you sir :tophat:.

Mhmm, uh huh… likely story :smirk:

7 Likes

Troid is not joyed.

Plugin be destroyed.

Thanks bugs.

New feature, debug!

Thanks Doug.

For real though, this feature was long overdue, and now I feel inspired to go repair a plugin I’ve been neglecting to fix. Thanks CycloneUprising, very cool.

Firstly, love this update post! 10/10!

Also love this new feature, it’s made plugin development so much easier!

One issue: Undo/Redo isn’t picking up any changes when I add/remove things to my plugins in PluginDebugService.

3 Likes

Thanks for bringing this great and useful feature :roblox_light: