Table To Object - Any Object-Based Value and functions!

Would you add metatable support in the future? I don’t see a use for it, but it may be useful to someone (I hope)

1 Like

I need to learn better about them! But I don’t see how you would use it…?

1 Like

I don’t see a use to convert metatables, as they only contain functions, and there is currently no way and use of storing them in some other place.

2 Likes

Can you add support for functions in table-instances using BindableFunctions? You can just set their .OnInvoke callback to the table’s function if typeof(value) == "function".

1 Like

How would I even do that? I know plugins can modify scripts but other scripts from my knownledge can’t.

2 Likes

Please get the new version of the module, here’s the changelog:

Every single value object in this list is supported:

image

Now, I solved a over-looked part of the code,
you coudn’t do ipairs with the transformed table because even if you used numbers as your indexes, that would technically be a string, that changed. Now if it’s a number, The index will be number when exporting it to a table again.

Pretty much that’s it.

If anyone used it on their game, please update it.

2 Likes

Update: module.InsertValueInto()
was released, i might update the post soon.

How it works, it’s that, you can insert any new value into an ALREADY EXISTING object-based table.
So this is example of code:

module.storage = … whatever that object table is:

module.InsertValueInto(“Table1”, 10, “Index”)
Table1 is the name of the object you wanna find inside of module.storage.
10 is the value you wanna put in.
“Index”, self explanatory, the name of the index (object name) that you wanna set it to.

if we wanted to insert a value into some folders inside the main folder of the object, how would we set the index on this function?

Well that’s not really possible using this function. I just realised, unless you wanna insert a table inside it.

But you can create your own system for that using Instance.new()
Using object based values like string values, intValues, and stuff, and having their name as their index. They would appear when getting a normal table from it as well.

Actually NVM, you COULD also set the module.Storage to the object-based table. (i need a name for that).
You could set it to the folder inside the table, and then insert it there. But remember to reset the module.storage later.

1 Like

Update: I added function support, It’s not perfect right now, it works fine, the only down-side is not being able to “delete” them, or “disconnect” these functions. If you create one, then you can expect it to stay on the function caching on the module right now, but just now I’m already working on adding support to that, which shoudn’t be hard, also now a lot of things have changed, basically, module.storage is not a thing anymore, instead you just reference the storage when calling CreateTable or CreateObject on the last paremeter.

Optimization over-all, and yeah. Also, if you don’t reference storage, it will use defaultStorage on the module. Which you can change. Right here:

TTO is now replaced by ObjectTables | Live object-based tables! Use that instead please.