Allow editor-level execution contexts for scripts

As a Roblox developer, it is currently too hard to create Studio tools targeted toward a specific game. A lot of developers create plugins that are only for a specific game, but these are forced to run on any game open in Studio.

If Roblox is able to address this issue, it would improve my development experience because myself and team members would be able to create game-specific tooling for Studio without having to find tricky ways to distribute the plugin.


Current Problem

The current way of doing this forces people to either publish their game-specific code as a plugin to the marketplace, or to distribute the plugin as an RBXM file to team members. Both of these are not ideal, because the marketplace would allow all people to grab the plugin, and distributing an RBXM is not user-friendly, especially for non-programmers.

Also, in order to make a plugin only work for a current place, you’d have to write specific code to check for the PlaceId or UniverseId, which is not very ideal, especially if the place could be standalone or exist in various dev/test environments.


Proposal

My request is that a new service container be added to the game hierarchy that runs scripts while in Studio, or add a new Script Context that runs scripts only in Studio. These scripts should only run in Studio, and shouldn’t run or be published with the actual game.

These could run in the same context as plugins, and thus have a way to listen for being unloaded after changes or explicit reloads (plugin.Unloading event).

27 Likes

I think Roblox is at least trying to fix this with packages, but they don’t really help a lot with this scenario.

Personally I think this is a great idea, although there is a fairly simple workaround that might make Roblox feel less obligated to incorporate it: have a script that loops through a bunch of modules that return functions, requires them, and then calls them only if it’s RunService:IsStudio. It’s an annoying workaround, but it still might make Roblox not care much.

Would need improvemets such as HttpService block, game:HttpGet complete removal and other risky features.

Yeah! I think if it is scoped the same way as a plugin, then it would work fine. Essentially a plugin that only lives in the context of a given place.

1 Like

Fun fact: Roblox already has a Plugin option for Enum.RunContext. Maybe opening it up to developers might provide a solution?

2 Likes