Jump to content

How does LinksetData work in an HUD?


Recommended Posts

I couldn't find any mention of this in the forums or the Wiki. I surmise that the linksetdata belongs to the root prim somehow - i.e. the avatar?

That would make it a crap shoot; ideally I'd like my HUD to maintain its own LSD and it gives the illusion of doing so.

Anyone have any idea ?A pointer to a document would be even better..

Link to comment
Share on other sites

A HUD is just like any other object.  It just happens to be attached to your avatar, the same way that any article of clothing or a weapon is attached.  LSD works the same way it does for a prim rezzed on the ground. 

  • Like 1
Link to comment
Share on other sites

30 minutes ago, Bavid Dailey said:

I surmise that the linksetdata belongs to the root prim somehow - i.e. the avatar?

for the purposes of LSD, and probably a lot of other things, the avatar is not the root prim of the attachment. the avatar itself does not store any LSD. I think a better way of thinking of it would be the avatar is kinda like its own region/sim.

  • Like 1
Link to comment
Share on other sites

from: llGetLinkKey:

Quote

When an avatar sits on an object, it is added to the end of the link set and will have the largest link number.

So, I would surmise (with no evidence to support mind you) that in regards to links the HUD will act similarly a "chair" in regards to link order. That when the HUD is attached, if there is a ad-hoc linkset created, the avatar would be added as the *last* link in the chain always and never the root.

Link to comment
Share on other sites

Wearing an object as an attachment does not impact the link order (or count) of a linkset, nor does it affect the object's linksetdata store. We can easily test this out:

/*
1. link 3 prims together
2. drop this scrit into the object.
3. attach object to avatar
4. click object.
*/

string lsdkey = "test-name";

default
{
    state_entry()
    {
        llSetPrimitiveParams([
            PRIM_LINK_TARGET, 1,
                PRIM_NAME, "root",
            PRIM_LINK_TARGET, 2,
                PRIM_NAME, "child-a",
            PRIM_LINK_TARGET, 3,
                PRIM_NAME, "child-b"
            ]);
        
        llLinksetDataWrite(lsdkey, "See you on the other side!");
        llOwnerSay("linkset consists of "+(string)llGetNumberOfPrims()+" prims");
    }

    touch_start(integer total_number)
    {
        integer x = llDetectedLinkNumber(0);
        integer y = llGetNumberOfPrims();
        llOwnerSay("clicked link# "+(string)x+" of "+(string)y+"; "+llGetLinkName(x));
        llOwnerSay("reading LSD key '"+lsdkey+"': "+llLinksetDataRead(lsdkey));
    }
}

 

  • Like 1
  • Thanks 2
Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...