Jump to content

Link Number madness


Gwydeon Nomad
 Share

You are about to reply to a thread that has been inactive for 566 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

Help me understand link numbers?

I link 10 prims together into one object, the primary script is in the root and there are scripts in other parts of the object to run buttons etc... Then I take the last prim which is colored on its four faces and link it to the object.  It is the eleventh(11th) prim linked to the object.

Firestorm (in Viewer 6 mode) reports the linked primitive as Link 11.

llGetLinkNumber(); in the script in the last primitive returns that it is actually in Link 10 (this could be a -1 error? However...)

llGetLinkPrimitiveParams([]); reading the color from a different script/prim in the object has to be told to look at Link 2, for it to correctly read a face color.

How are these so different, and how is the number 2 working when I link the primitive in question last?  Link order is no longer tied to the order you link?  @_@

image.png.b0c7f6ae3a2ead780d4b33e307c582f3.png

 

I've been going in circles trying to figure out why my code wasn't reading and reporting the face color... for hours now.

EDIT: Apparently the issue is that Firestorm is not aware that Link Numbers do not follow linked order (as stated by LSL Wiki), but are configured auto-magically and are not necessarily logical.  llGetLinkNumber(); returns the truth.  Taking the object and the resing it again will allow Firestorm to report the correct link number (until/unless linkage is changed).

Edited by Gwydeon Nomad
Link to comment
Share on other sites

As you noticed, the link numbers are not correct IIRC in any viewer until the object has been re-rezzed. This goes for every linking operation and can be a hassle if you repeatedly need to adjust links, but you can trust any scripted function to always have the correct numbers and parameters immediately.

Edited by Frionil Fang
  • Like 2
Link to comment
Share on other sites

When a new link is added to the linkset it used to become the last link, but that hasn't been the case for... many years. Viewers still act the way we would expect the link numbering to act, but reality is different server-side.

Don't rely on link numbers, write a little function that indexes links by name or something.

Edited by Wulfie Reanimator
  • Like 1
Link to comment
Share on other sites

Last time I checked, when you link a set of prims 1234 to ABCD you often end up with something like A1234BCD. As others have mentioned, don't rely on link-numbers when you have a reasonable expectation that unlinking/relinking may happen. Do a scan for link-name/description on state_entry and CHANGED_LINK.

 

Edited by Quistess Alpha
  • Like 1
Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 566 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...