How would this work for existing property names? How would this work for children with the same name? Which would have more precedence? This is already an issue where Roblox adds conflicting property names, that is why you should use :FindFirstChild
for getting instances from name. So they likely only allow interacting with attributes through getters and setters so this issue is avoided.
Dirty ValueBases be gone! Is it recommended to cache GetAttribute and update the cache on AttributeChanged? Or does roblox already do this?
I know for ValueBases you have to do this if you’re reading from a value frequently
Awesome! I will 100% have a go with this.
Awesome!
I closed Studio to renew some items and when I came back and selected an item, the properties showed “Add Attribute”.
This is finally here, as it takes away configuration folders and values.
I am disappointed that the beta post mentioned implementing new value types, and yet Object and CFrame, the most requested value types, have yet to be supported.
Nice update nonetheless.
-
Can we have a list of supported types?
-
I assume that Attributes behave like CollectionService for replication?
(Server will overwrite / remove Client Attributes)
AttributeService supports using Instance as an Attribute
Love the update, Happy its out now!
I’ve been waiting for this! I can finally make my items (dropped items ingame) have proper IDs attached without having to deal with using a value object! Not to mention the uses this will have for oop
Object values are pretty understandable. What if you stored an array of instances in an attribute, and one of the instances was destroyed. Would the array have a hole? It’s just asking for confusing replication behaviors.
Speaking of arrays, I don’t think you can store multiple objects in a single attribute to begin with. That’s another high-demand feature.
This is gonna be soo useful for game development so you don’t have piles of values in models or parts. Good addition! Also will be good used with OOP.
Seems handy! Are there any performance benefits to using Attributes over Value Instances?
Will attributes ever support tables or sub-data within a field similar to Position having (X,Y,Z)?
Fantastic feature. Wow! I can’t wait to try porting some features over to this. Will have to do testing! Good work Roblox Staff.
For now I believe what you do can is, json-encode your array when setting, and json-decode when getting, but I think native support would be much better, and it not returning a copy, so you can do table.insert(inst:GetAttribute(name)[, i], v)
and it will apply to the same table and not return a new one each time
This going to be a Fire feature in Roblox Studio now all I just got to do is learn how to use and incorporate it into my Roblox game.
I did notice that there isn’t an Object option for the attributes, I can easily just use an ObjectValue for the specific instance that would need one, but will there be an Object attribute in the future??
This is fantastic, already in the middle of changing EVERYTHING in my current projects! A little extra thing that would be pretty cool would be the ability to add headers in between the attributes, kinda like Unity -
For some objects, I have variables set by both me and my scripts, so being able to organize these would be awesome!
Oh I see. It looks like binary strings are supported (like "\0\1\2\3"
), so you can store raw data using string.pack
. You would need to set up your own studio tools to edit these values though. The main use for array support would just be studio convenience.
It looks like I’ll be using attributes to store massive binary strings. We can finally store strings with "\0"
characters and it supports values longer than 200,000! I have a lot of code dedicated to escaping "\0"
and separating binary strings longer than 199,999 into multiple StringValues.
THIS. IS AMAZING!!! GONE ARE THE DAYS OF FORGETTING TO BUT ValueTypeInstance.Value!!! BYE BYE, VALUES!