npm.io
0.0.0 • Published 7 years ago

rbxts-object-to-tree

Licence
ISC
Version
0.0.0
Deps
3
Size
11 kB
Vulns
0
Weekly
0
Stars
7

roblox-ts object-to-tree

You can install this plugin here.

Simply select the instance you want converted into a tree, and click on the plugin to generate its tree.

Outputted trees look like so:

type SpawnLocation = SpawnLocation & {
	Decal: Decal;
	Data: Configuration & {
		NumSpawns: IntValue;
		GiveForceField: BoolValue;
	};
}

The plugin also supports overriding services which are browsable in Roblox Studio. For example:

interface Workspace extends Model {
	Terrain: Terrain;
	Camera: Camera;
	Baseplate: Part & {
		BFC: BoolValue;
	};
	SpawnLocation: SpawnLocation & {
		Decal: Decal;
		Data: Configuration & {
			NumSpawns: IntValue;
			GiveForceField: BoolValue;
		};
	};
}

Then, anywhere you access Workspace, you can access the defined members!

const workspace = game.GetService("Workspace");
print(++workspace.SpawnLocation.Data.NumSpawns.Value);

To automatically insert these files into your project open up your project and run npx io-serve, then click the plugin in studio to generate your files.

Note: This plugin in no way guarantees that objects defined in TS this way will exist at run-time. Scripts can rename instances, move them around, or delete them. Don't do those things if you want the definition to be valid.

Help wanted

If someone would like to make an icon for this plugin, it would be much appreciated!