Log in to vote

Table Instance subclass heirarchy? [Solved]

Asked by
eLunate 5136 Trusted Moderation Voter Community Moderator
5 years ago

This question has been solved by the original poster.

I'm not talking about the object heirarchy

I need a simple way to build dictionary style 1D table containing all of the Instance subclass types, where each key is the ClassName (including types that are only inherited), and the value is a table that has its __index set to the table for the subclass.

What am I actually asking for?
I need either something to parse the entire list of Instance subclasses, or more ideally (currently) a table of tables with the inheritance structure already established.

Why? I need to provide override inheritance for Valkyrie method overrides, and until now I have lazily been simply checking the ClassName against the table of override methods.

Look into ReflectionMetadata. I can't give a more complete answer here because I don't know one myself. adark 5467 — 5y
I'm currently bugging TickerOfTime about it. If I get a solution, would it be acceptable to simply delete the answer if no solution is given? Or should I post my solution as an answer and leave it? eLunate 5136 — 5y

1 answer

Log in to vote
Answered by
eLunate 5136 Trusted Moderation Voter Community Moderator
5 years ago


local http = game:GetService("HttpService");
local instancetable = http:JSONDecode(http:GetAsync("")).Class;
do local iOverrides = self.Overrides.Instance;
    for k,v in next, instancetable do
        iOverrides[k] = setmetatable({},{__index = iOverrides[v.BaseClassName]});

This solution uses TickerOfTime's API Parser


Answer this question