Is there any built in functionality that allows for sections of a library to look back at their path ancestry (in order to locate an immediate parent library)?
I know a solution to this, but it involves iterating through an entire library to locate a match. I would much rather not.
Visualized:
Say that I create a local and set its value to B[X][X’] (the value of X’). The moment that I do this, the local becomes independent. Because it is separated from its grandparent “B”, it has become its own root. I want to match X in the library from the local that I’ve created (X’).
What data type is “X’?” If it is a table or can be cast to a table, you could feasibly set up the parent-child hierarchy that ROBLOX uses with Instances with your library structure instead. If your library cannot be structured as all values being tables, though, then you can’t really point backwards. Tables only drill down by default.
Alternatively, you can define the “parents” as variables in the same scope you define X’, but that is not a very expandable method.
I was using tables with dictionaries. I bit the bullet and decided to iterate through the descendants of the dictionary values in order to “match” a value that contained the library that I started with.