Skip to main content

jabby

The adapter for jabby, the ECS debugger written against jecs internals. mErCS keeps no archetypes and no entity index, and the library has nothing that exists only for jabby: this module adds what jabby reads.

require(mErCS.jabby)(ecs) returns a jecs-like module for jabby: the exports of mErCS plus jabby.attach, jabby.entity_index_try_get and jabby.is_tag.

  1. The jabby package requires jecs through a module of its own (with Wally: Packages/_Index/alicesaidhi_jabby@<version>/jecs). Replace its source with

    local mErCS = game:GetService("ReplicatedStorage").mErCS -- the ModuleScript
    return require(mErCS.jabby)(require(mErCS))
    
  2. Attach every world before registering it:

    require(mErCS.jabby)(ecs).attach(world)
    jabby.register({ applet = jabby.applets.world, name = "World", configuration = { world = world } })
    

Functions​

attach​

jabby.attach(world: World) → World--

the same world

Gives the world world.entity_index and gives its queries iter() (a stateful iterator) and archetypes() (one pseudo archetype { entities = {...} } with the matches). Attaching a world again changes nothing; other worlds are not affected.

is_tag​

jabby.is_tag(
world: World,
id: Id
) → boolean

Whether the id carries no data: an entity without the mErCS.Component trait, or a pair whose relation and target are both tags.

entity_index_try_get​

jabby.entity_index_try_get(
entity_index: {world: World},--

world.entity_index of an attached world

entity: Id
) → {archetype: {types: {Id}}}?--

nil when the entity is not alive

The record of an entity as jabby reads it: its archetype lists the ids of the entity (see World:ids).

Show raw api
{
    "functions": [
        {
            "name": "attach",
            "desc": "Gives the world `world.entity_index` and gives its queries `iter()` (a stateful iterator)\nand `archetypes()` (one pseudo archetype `{ entities = {...} }` with the matches).\nAttaching a world again changes nothing; other worlds are not affected.",
            "params": [
                {
                    "name": "world",
                    "desc": "",
                    "lua_type": "World"
                }
            ],
            "returns": [
                {
                    "desc": "the same world",
                    "lua_type": "World"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 68,
                "path": "src/jabby.luau"
            }
        },
        {
            "name": "is_tag",
            "desc": "Whether the id carries no data: an entity without the [mErCS.Component] trait, or a\npair whose relation and target are both tags.\n    ",
            "params": [
                {
                    "name": "world",
                    "desc": "",
                    "lua_type": "World"
                },
                {
                    "name": "id",
                    "desc": "",
                    "lua_type": "Id"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "boolean"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 95,
                "path": "src/jabby.luau"
            }
        },
        {
            "name": "entity_index_try_get",
            "desc": "The record of an entity as jabby reads it: its archetype lists the ids of the entity\n(see [World:ids]).\n    ",
            "params": [
                {
                    "name": "entity_index",
                    "desc": "world.entity_index of an attached world",
                    "lua_type": "{ world: World }"
                },
                {
                    "name": "entity",
                    "desc": "",
                    "lua_type": "Id"
                }
            ],
            "returns": [
                {
                    "desc": "nil when the entity is not alive",
                    "lua_type": "{ archetype: { types: { Id } } }?"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 112,
                "path": "src/jabby.luau"
            }
        }
    ],
    "properties": [],
    "types": [],
    "name": "jabby",
    "desc": "The adapter for [jabby](https://github.com/alicesaidhi/jabby), the ECS debugger written\nagainst jecs internals. mErCS keeps no archetypes and no entity index, and the library\nhas nothing that exists only for jabby: this module adds what jabby reads.\n\n`require(mErCS.jabby)(ecs)` returns a jecs-like module for jabby: the exports of\n[mErCS] plus [jabby.attach], [jabby.entity_index_try_get] and [jabby.is_tag].\n\n1. The jabby package requires jecs through a module of its own (with Wally:\n   `Packages/_Index/alicesaidhi_jabby@<version>/jecs`). Replace its source with\n\n   ```lua\n   local mErCS = game:GetService(\"ReplicatedStorage\").mErCS -- the ModuleScript\n   return require(mErCS.jabby)(require(mErCS))\n   ```\n\n2. Attach every world before registering it:\n\n   ```lua\n   require(mErCS.jabby)(ecs).attach(world)\n   jabby.register({ applet = jabby.applets.world, name = \"World\", configuration = { world = world } })\n   ```",
    "source": {
        "line": 27,
        "path": "src/jabby.luau"
    }
}