Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Table Instance subclass heirarchy? [Solved]

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.

2 comments

0

Look into ReflectionMetadata. I can't give a more complete answer here because I don't know one myself.

1

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?

1 answer

Solved

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

This solution uses TickerOfTime's API Parser

This discussion is preserved as it was. New answers, comments, and votes are closed.