Gwydeon Nomad Posted October 19, 2022 Share Posted October 19, 2022 (edited) 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? @_@ 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 October 19, 2022 by Gwydeon Nomad Link to comment Share on other sites More sharing options...
Frionil Fang Posted October 19, 2022 Share Posted October 19, 2022 (edited) 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 October 19, 2022 by Frionil Fang 2 Link to comment Share on other sites More sharing options...
Wulfie Reanimator Posted October 19, 2022 Share Posted October 19, 2022 (edited) 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 October 19, 2022 by Wulfie Reanimator 1 Link to comment Share on other sites More sharing options...
Quistess Alpha Posted October 19, 2022 Share Posted October 19, 2022 (edited) 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 October 19, 2022 by Quistess Alpha 1 Link to comment Share on other sites More sharing options...
Recommended Posts
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