Thinking about new features for Roblox Studio.Data Table, Inspector, Prefabs

I think about what would try to implement new features for Roblox Studio. I keep missing features that I was using in unity and unreal engine, specifically:

Data Table

Creating a list of variables editable through the interface, as an excel table. This allows you to create an Enum, or for example to quickly change the damage of the weapon, several at once.

Inspector

Edit the configuration of some object, when you click on it. For example, you have a weapon, you click on it and can change its parameters (damage, animation, attack speed) through a nice and convenient interface. And for this you do not need to go into the config or code.
image

Prefabs

Prefabs - Allows you to save a template of an object, and place a copy of it in the game. If you change the original template, all changes to all copies are applied to the game. At the same time, the copies can be customized through the Inspector.

These features are very good to boost the development of the game. Allows you to quickly fix bugs, and change a bunch of settings in just one window interface.

I’ve already tried to create my own Inspector for Roblox . If you ignore a few bugs, it’s a very handy tool. It’s helped me cut down hours of project development many times over. I already know how to make it even better - I need to connect Data Table to it, and rewrite all the code :slightly_smiling_face:

Now about what I want to do

Data Table

A plugin that creates date tables. We click the button, create a table and we have this interface.

We create a column, for example Level. Check that it is the main column, as if it were a PrimaryPart. Create a few more columns, for example this setting levels of mobs. Damage, whether the bot can run, what he has in his hand weapon, walking speed, drop from mobs.

And now we can fill in the lines, like in Excel. For example a level 1 mob deals 4dm and walks with speed 12. Then we can use the script to get these values! About the script later. This is basically how Data Table works in Unreal Engine. But there is something I missed even in Unreal Engine - Excel FORMULES (f).

Here’s how it works, you click on the Damage column, and in the formula field you enter:

= 5 + level * 3

As a result, for the first level mob, Damage will be: =5 + 1 * 3

And all the values of the strings will be calculated themselves.

Just as I would like to export it to excel, and back. To do this, you can use the format parsing excel:

image

When we copy the selected cells from Excel, a large space will be used instead of the cell separator (Tab Button). This works for importing and exporting.

You may ask - what about formulas?
image

-Easy! If you write a formula in quotes, it will be imported.

How do you transfer a formula from Excel to Roblox ?

-That’s where you got me! But since the column works on the formula, all its values become disabled (they are locked).

How do you use this in your code?

Every date table is inside the Module Script. The script itself changes through .Source every time we change a table. The module contains functions to work, hints to auto complite.

local module = {}

local LibQuery = {}; --require()

module.Keys = {
    Level = 1,
    DamageCount = 2,
    CanRun = 2,
    Weapon = 3,
    WalkingSpeed = 4,
    XpDrop = 5,
    CashDrop = 6,
};

module.Bake = {
    [1] = {
        Level = 1,
        DamageCount = 4,
        CanRun = false,
        Weapon = "SwordGold",
        WalkingSpeed = 12,
        XpDrop = 7,
        CashDrop = 7,
    },
    [2] = {
        Level = 1,
        DamageCount = 7,
        CanRun = false,
        Weapon = "SwordGold",
        WalkingSpeed = 12,
        XpDrop = 9,
        CashDrop = 9,
    }  
};

module.GetRowByInd = function(ind)
    local ColumAutoComplite = {
        Level = 1,
        DamageCount = 2,
        CanRun = 2,
        Weapon = 3,
        WalkingSpeed = 4,
        XpDrop = 5,
        CashDrop = 6,
    } 

    if(module.Bake[ind])then
        return module.Bake[ind];
    end

    if(not module.Bake[ind])then
        return nil;
    end

    return ColumAutoComplite;
end


module.Query= function(ind, operator, val)
    local result = {};
    local count = 0;
    
    for _, Row in pairs(module.Bake) do
        if(not LibQuery.isValidateRequest(Row, ind, operator, val)) then continue end
        table.insert(result, Row);
        count += 1;
    end
    
    if(count<=0)then
        return;
    end
    
    return result;
end
 


return module;

Then we simply plug this module into our script:

And we have autocomplete!

Another function of the tables is search queries. For example, you need to connect a list of all mobs that have Damage > 5

local Rows = DataTable_MobLevel.Query(DataTable_MobLevel.Keys.DamageCount, ">", 5);

One search query is not enough, so you have to put an Array of several search queries into the function. For example Damage > 5 AND Level < 12

What’s this for? For example you need to make a selection from a database of items, by price, level or something else to give the player a drop.

This code would be more compact for me. And if you fantasize about the future, you could make a system of indexing that would make the search engine work better than just for.

Inspector

As I said I already have a working prototype (even probably an alpha version) which I use in all my projects.

It is based on my PluginReact library, for which there is still no documentation xD [Closed] PluginReact | A set of ui elements to create plugin

Prefabs

The rest of the tools are fine for me. But Prefab is a very complex system. Because it implies inheritance. So you can make a prefab into another prefab. It is a very complex system. You need to philosophize and think over a lot of different situations. But I already know how to do the basic version.

  1. We create a prefab from an object.

  2. The object is transferred to a folder inside the SS. And a new icon appears in the window prefab.

image

  1. We click on the icon and drag it to Workspce. A Prafab clone appears on the place where the cursor stops. This clone is cleared of all scripts, it’s just a part and mesh model. But inside it has a StringValue called __PREFAB_IND_Bot_Sam

  2. We open the original, change its appearance, color and so on. And we press Update in the plugin window. And all the clones immediately accept these changes.

  3. When the game starts, the server immediately goes through the prefabs and their clones. And replaces the clones with the original, in the same position with the same angle.

Seems easy? But no. Here are a few situations I can predict right now:

-If PrimaryPart changes. The object will move out of its positions and angles.

-If I decide to customize the clone. Change the color in it. This change will be overwritten. You could make a selective change, but that will create a bunch more situations.

-We need to think about how Inspector will work with clones and originals. You can’t overwrite this data, otherwise the entire system gets useless.

And there can be a lot of such situations!

That’s what I think about almost every day.

As soon as my budget allows me, I’ll go do these systems, it’s inevitable. And if I don’t, someone else will.

I used Figma components for the prototype:

4 Likes

A lot of this would be really useful. I’ve recently switched over a lot of things in my game and now I find myself having to manually edit tons of scripts and models to update them.

1 Like