omarcoaraujo/backstage
Live tuning panel for Roblox Studio: edit game values in real time
Backstage
Live tuning panel for Roblox Studio: edit game values in real time.
The read-only rows and expandable tables are built and shown in the UI stories, but config does not produce them yet. They arrive with store support.
Features
- Declare your game values once and tune them in a window while you play in Studio
- Sliders, toggles, text, choices, colors with a picker, vectors and buttons
- Limits per value:
min,max,stepand a list of choices - Search bar that filters the tree by name
- A reset button on every changed value, and an optional tool that saves what you tuned back into your config scripts
- Zero cost in production: outside Studio the config is a frozen copy and there is no UI, no remote and no listener
Installation
Add it to your pesde.toml:
[dependencies]
backstage = { name = "omarcoaraujo/backstage", version = "^0.1.0" }
Usage
Declaring values
const backstage = require(path.to.backstage)
return backstage.config("pets", {
distance = 6,
tint = Color3.fromRGB(255, 200, 80),
mode = "follow",
respawn = backstage.button(),
trail = {
enabled = true,
length = 1.5,
},
}, {
limits = {
distance = { min = 0, max = 30, step = 0.1 },
mode = { choices = { "follow", "orbit" } },
trail = {
length = { min = 0.1, max = 6, step = 0.1 },
},
},
})
The kind of each value comes from its default: number, boolean, string, Color3 or Vector3. A choices limit turns a string into a choice. Nested tables become groups.
Read the values as plain fields, always through the returned table, so you see the latest edit:
const config = require(path.to.pets_config)
print(config.distance, config.trail.length)
config.respawn:connect(function()
-- the button was pressed
end)
The game cannot write to the config. Only the window does, and writing from code raises an error.
Opening the window
Call start on the client, and on the server if you want to tune server values too:
const backstage = require(path.to.backstage)
backstage.start()
A config declared in a shared module shows up once in the window. The server owns its value: an edit goes to the server, which validates it and tells every client. A config declared only on the server shows up in the window too, and its buttons run on the server.
Ctrl + B opens and closes the window. Pass key and ctrl to change it:
backstage.start { key = Enum.KeyCode.F4, ctrl = false }
Production
start does nothing outside Studio, and config returns a frozen copy of the defaults, so the values you declared are the ones the game ships with. Use backstage.disable() to test that mode inside Studio, and backstage.enable() to force the Studio mode.
A complete project is in example/.
Saving values into your scripts
Without the tool, edits live in the play session and are lost when it ends. With it, every change is written back into the default of the matching backstage.config call, in place, so the next session starts from what you tuned.
Install it with Rokit and point it at your project folder while Studio is open:
rokit add omarcoaraujo/backstage
backstage . --port 34891
Enable Allow HTTP Requests in the game settings of the place. The tool listens only on 127.0.0.1, finds each config by name across the project, and refuses a name that is declared in two files or a value that is not a literal. --port is optional, and the same number goes to backstage.start { port = 34891 } if you change it.
Limitations
- Backstage is pre-1.0, so the API can still change between minor versions.
- Without the tool, edits are lost when the play session ends. Values declared only on the client stay local to that client.
- Editing values of stores you already have (Vide, Charm) is not there yet.
Contributing
See CONTRIBUTING.md.
License
MIT