Socket
Book a DemoInstallSign in
Socket

@rbxts/gorp

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@rbxts/gorp

A hacky ECS debugger

latest
Source
npmnpm
Version
0.2.0-ts.3
Version published
Maintainers
1
Created
Source

gorp-ts

Fork of gorp for Roblox-ts.

Notice

It is preferred that you use jabby / ebba for new work.

Differences to Luau version

  • This package is versioned with <gorp version>-ts.<x> where x is incremented for any changes to the TS version in particular.

Code sample with ecr

The following requires the gorp-ecr package

Server

import ecr from "@rbxts/ecr";
import gorp from "@rbxts/gorp";
import gorp_ecr from "@rbxts/gorp-ecr";

// Required, sets up the ecs layer for ecr
gorp_ecr.init({ ecr, gorp });

Client

import ecr from "@rbxts/ecr";
import gorp from "@rbxts/gorp";
import gorp_ecr from "@rbxts/gorp-ecr";

// Required, sets up the ecs layer for ecr
gorp_ecr.init({ ecr, gorp });

// Create components
const Position = ecr.component(() => Vector3.zero);
const Velocity = ecr.component<Vector3>();

// Assign names to components
gorp.names({ pos: Position, vel: Velocity });

// Create world and assign name
const world = ecr.registry();
gorp.hook_world(world, "main_world");

// Get the client and mount the selector interface
const client = gorp.get_client();
client.gorp_selector();

// Create entity, assign components
const ent = world.create();
world.add(ent, Position);
world.set(ent, Velocity, Vector3.xAxis);

// Create scheduler
const scheduler = gorp.scheduler("main_scheduler");

function position_system(dt: number) {
	for (const [id, pos, vel] of world.view(Position, Velocity)) {
		world.set(id, Position, pos.add(vel.mul(dt)));
	}
}

// Run the system every frame in the scheduler
game.GetService("RunService").RenderStepped.Connect((dt) => {
	scheduler.system("position_system", position_system, dt);
	scheduler.finish();
});

// Connect F keybind to toggle the interface
game.GetService("UserInputService").InputBegan.Connect((input) => {
	if (input.KeyCode === Enum.KeyCode.F) {
		client.enabled(!client.enabled());
	}
});

FAQs

Package last updated on 21 May 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts