skimi3d Grid Log in Visit the grid
All scripts
Building helpers

Link Numbers

Writes each prim's link number over its head, so you can see the order of a linkset instead of guessing at it. Put it in, look, take it out.

Goes inAny prim of the linkset you are checking
Setupnothing to set
Code85 lines
Open toOpen to everyone

What it does

It puts the link number of every prim in the set above that prim as hover text, with the root in green because the root is always number 1 and worth picking out at a glance. Touching turns the numbers off and on. Re-linking renumbers everything, and it notices, so the numbers you are looking at are always the current ones rather than the ones from before you changed your mind.

What you can build with it

Nothing. It is a tool for building other things: any script that addresses prims by number needs you to know the numbers first. A destination board lighting panels 1, 2 and 3 along the front and 4, 5 and 6 along the back is unarguable when you can see them, and a morning of quiet nonsense when you cannot.

How to use it

1 Drop this script into any prim of the linkset. It does not matter which.
2 Look. Every prim now says its number, and the root says 1 in green.
3 If the order is wrong, re-link and look again. It updates by itself.
4 Touch it to turn the numbers off.
5 Turn them off BEFORE you take the script out, then take it out. It is a tool, not a fitting.

Settings you can change

2

Edit these at the top of the script. Everything works on the defaults · change them only when you need to.

ROOT_COLOUR The colour of the root prim's number. The root is always link 1 and worth picking out at a glance. <0.35, 1.00, 0.45>
OTHER_COLOUR The colour of every other number. <1.00, 0.85, 0.20>
The code LSL · 85 lines · updated 8 Sep 2026 Download .lsl
// =====================================================================
//  Link Numbers
//  skimi3d script library
//  https://grid.skimi3d.com/scripts/link-numbers
//
//  Writes each prim's link number over its head, so you can see the
//  order of a linkset instead of guessing at it.
//
//  You need this the moment a script starts addressing prims by number.
//  A destination board that lights panels 1, 2 and 3 along the front and
//  4, 5 and 6 along the back is unarguable when you can see the numbers,
//  and a morning of quiet nonsense when you cannot.
//
//  Put it in, look, take it out. It is a tool, not a fitting.
//
//  Plain LSL.
// =====================================================================


// ---------------------------------------------------------------------
//  Settings
// ---------------------------------------------------------------------

// The root prim is always link number 1, and it is worth being able to
// pick it out at a glance, so it gets its own colour.
vector ROOT_COLOUR  = <0.35, 1.00, 0.45>;
vector OTHER_COLOUR = <1.00, 0.85, 0.20>;


// ---------------------------------------------------------------------
//  Everything below here is the machinery
// ---------------------------------------------------------------------

integer gShowing = TRUE;


show(integer on)
{
    integer n = llGetNumberOfPrims();
    integer i;

    for (i = 1; i <= n; ++i)
    {
        if (on)
        {
            vector colour = OTHER_COLOUR;
            if (i == 1) colour = ROOT_COLOUR;

            llSetLinkPrimitiveParamsFast(i, [PRIM_TEXT, (string)i, colour, 1.0]);
        }
        else
        {
            llSetLinkPrimitiveParamsFast(i, [PRIM_TEXT, "", ZERO_VECTOR, 0.0]);
        }
    }
}


default
{
    state_entry()
    {
        show(TRUE);

        // The warning matters more than it looks. Hover text belongs to
        // the prim, not to the script, so taking the script out while
        // the numbers are showing leaves them showing for ever, and
        // there is no event that lets a script tidy up after itself as
        // it is removed. Touch first, take out second.
        llOwnerSay("Link numbers on. The root is 1, in green. Touch to turn them off, and turn them off BEFORE you take this script out, or the numbers stay.");
    }

    touch_start(integer total)
    {
        gShowing = !gShowing;
        show(gShowing);
    }

    changed(integer what)
    {
        // Re-linking renumbers everything, which is exactly the moment
        // you want to look again.
        if (what & CHANGED_LINK) show(gShowing);
    }
}

Copy it, make a new script inworld, paste over what is there and save. Nothing here phones home.