PRIM LINK TARGET
From Second Life Wiki
| LSL Portal | Functions | Events | Types | Operators | Constants | Flow Control | Script Library | Categorized Library | Tutorials |
Contents |
Description
Constant: integer PRIM_LINK_TARGET = 34;The integer constant PRIM_LINK_TARGET has the value 34
Used to get or set multiple links with a single PrimParameters call.
llSetPrimitiveParams
llSetPrimitiveParams([ PRIM_LINK_TARGET, integer link_target ]);| • integer | link_target | – | Link number (0: unlinked, 1: root prim, >1: child prims) or a LINK_* flag |
The same syntax applies to llSetLinkPrimitiveParams and llSetLinkPrimitiveParamsFast but with an additional prefixed link parameter in the function call.
llGetPrimitiveParams
llGetPrimitiveParams([ PRIM_LINK_TARGET ]);Returns the list [ integer link_target ]
| • integer | link_target | – | Link number (0: unlinked, 1: root prim, >1: child prims) or a LINK_* flag |
The same syntax applies to llGetLinkPrimitiveParams, but with an additional prefixed link parameter in the function call.
Caveats
- The prim description is limited to 127 bytes, any string longer then that will be truncated. This truncation does not always happen when the attribute is set or read.
- The pipe character '|' and the newline character '\n' are not legal in a prim's description, they will be replaced by with '?'[1].
- Note that when people have "Hover Tips on All Objects" selected in the viewer's "View" menu, they'll see the object description pop-up for any object under their mouse pointer. For that reason, it is good practice to only set human-friendly information in the description (e.g. keys and such).
- When an attached object is detached, changes made by script to the name and description (of the root prim) of the attachment will be lost. While the object is attached the name and description can be changed but it will not be reflected in inventory. This caveat does not apply to child prims.
- If texture is missing from the prim's inventory and it is not a UUID or it is not a texture then an error is shouted on DEBUG_CHANNEL.
- If texture is a UUID then there are no new asset permissions consequences for the object.
- The resulting object develops no new usage restrictions that might have occurred if the asset had been placed in the prims inventory.
- repeats is not only used to set the number of repeats but the sign of the individual components is also used to set the "Flip" attribute.
- As with llGetTexture, NULL_KEY is returned when the owner does not have full permissions to the object and the texture is not in the prim's inventory.
- In the default texture mapping mode the texture repeats units are in texture repeats per face. In the planar texture mapping mode the texture repeats units are in texture repeats per half meter. This is in contrast to the in-world editing tool, in which the planar texture scaling units are repeats per meter.
- Do not rely on Floating Text as a storage medium; it is neither secure nor finalized.
- Floating text has been altered in past server updates, breaking existing content; future changes may occur.
- Even "invisible"[2] floating text is transmitted to the client.
- It can be viewed by anyone with a client that is capable of rendering text that is supposed to be invisible.
- The network packets that contain the text can be sniffed and the text read.
- top_size and client values are different, the ranges do not line up, conversion is required. This simple equation can be used: answer = 1.0 - value. See top_size Explained for more information.
- PRIM_OMEGA on nonphysical objects, and child prims of physical objects, is only a client side effect; the object or prim will collide as non-moving geometry.
- PRIM_OMEGA cannot be used on avatars sitting on the object. It will emit the error message "PRIM_OMEGA disallowed on agent".
- If PRIM_OMEGA does not appear to be working, make sure that that Develop > Network > Velocity Interpolate Objects is enabled on the viewer.
- A collision between two objects with restitution 1.0 will still not be perfectly elastic due to damping in the physics engine.
- If PRIM_LINK_TARGET's link_target describes a seated avatar...
- Flags not explicitly mentioned have obvious values.
- PRIM_NAME will return the avatar's legacy name.
- PRIM_DESC will return
"". - PRIM_TYPE will return
[PRIM_TYPE_BOX, PRIM_HOLE_DEFAULT, <0., 1., 0.>, 0., <0., 0., 0.>, <1., 1., 0.>, <0., 0., 0.>] - PRIM_SLICE will return
[<0., 1., 0.>] - PRIM_MATERIAL will return
PRIM_MATERIAL_FLESH. - PRIM_TEMP_ON_REZ will return
FALSE. - PRIM_PHANTOM will return
FALSE. - PRIM_SIZE will return
llGetAgentSize(llGetLinkKey(link)). - PRIM_TEXT will return
["", <0., 0., 0.>, 1.]. - PRIM_POINT_LIGHT will return
[FALSE, <0., 0., 0.>, 0., 0., 0.]. - PRIM_FLEXIBLE will return
[FALSE, 0, 0., 0., 0., 0., <0., 0., 0.>]. - PRIM_COLOR, PRIM_TEXTURE, PRIM_GLOW, PRIM_FULLBRIGHT, PRIM_BUMP_SHINY, PRIM_TEXGEN
- will return the values for 21 faces.[6]
- Regardless of the face specified, the values are always defaults:
flag Flag return for a single face. [ PRIM_COLOR ] [ ZERO_VECTOR, 0.0 ] [ PRIM_GLOW ] [ 0.0 ] [ PRIM_TEXTURE ] [ "", ZERO_VECTOR, ZERO_VECTOR, 0.0 ] [ PRIM_FULLBRIGHT ] [ FALSE ] [ PRIM_TEXGEN ] [ PRIM_TEXGEN_DEFAULT ] [ PRIM_BUMP_SHINY ] [ PRIM_SHINY_NONE, PRIM_BUMP_NONE ]
Related Articles
Constants
|
| ||||||||||||
Functions
| • | llSetLinkPrimitiveParams | |||
| • | llSetLinkPrimitiveParamsFast | |||
| • | llGetLinkPrimitiveParams | |||
| • | llSetPrimitiveParams | |||
| • | llGetPrimitiveParams | |||
| • | llGetLinkNumber | – | Returns the link number of the prim the script is in. |
Articles
| • | Limits | – | SL limits and constrictions | |
| • | Color in LSL | |||
| • | Translucent Color |
Notes
Link Numbers
Each prim that makes up an object has an address, a link number. To access a specific prim in the object, the prim's link number must be known. In addition to prims having link numbers, avatars seated upon the object do as well.
- If an object consists of only one prim, and there are no avatars seated upon it, the (root) prim's link number is zero.
- However, if the object is made up of multiple prims or there is an avatar seated upon the object, the root prim's link number is one.
When an avatar sits on an object, it is added to the end of the link set and will have the largest link number. In addition to this, while an avatar is seated upon an object, the object is unable to link or unlink prims without unseating the avatars first.
Counting Prims & Avatars
There are two functions of interest when trying to find the number of prims and avatars on an object.
-
llGetNumberOfPrims()- Returns the number of prims and seated avatars. -
llGetObjectPrimCount(llGetKey())- Returns only the number of prims in the object but will return zero for attachments.
integer GetPrimCount() { //always returns only the number of prims if(llGetAttached())//Is it attached? return llGetNumberOfPrims();//returns avatars and prims but attachments can't be sat on. return llGetObjectPrimCount(llGetKey());//returns only prims but won't work on attachments. }See llGetNumberOfPrims for more about counting prims and avatars.
Deep Notes
| Range[3] | Top Tapered | No Tapering | Bottom Tapered | |
|---|---|---|---|---|
| Client | [-1, 1] | 1.0 | 0.0 | -1.0 |
| PRIM_TYPE | [0, 2] | 0.0 | 1.0 | 2.0 |
| LEGACY | [0, 1] | 0.0 | 1.0 | NA |
| Client < 1.11 | [0, 1] | 0.0 | 1.0 | NA |
top_size Explained
When the original PRIM_TYPE interface was retired (PRIM_TYPE_LEGACY, SL 1.5), the new PRIM_TYPE interface did not yet support tapering of the bottom of the prim, this feature wasn't added until SL 1.11 (two years later). Instead of retiring the new PRIM_TYPE when it was added, the range of top_size was enlarged; meanwhile in the client they redefined the parameter and it's values. This redefinition and range enlargement resulted in two interfaces that did the same thing but achieved it through different values. Meanwhile PRIM_TYPE_LEGACY's interface was not updated to support tapering of the bottom of the prim. Consequently all three interfaces have different ranges, making for a rather nasty caveat.
History
- Content taken from Release Notes/Second Life Server/11#11.09.23.241511
- Documentation expanded with information from Physics Material Settings test.
All Issues
~ Search JIRA for related Issues| | SVC-914 | [A, C] | CHANGED_TEXTURE is not triggered when texture is changed via script |
Footnotes
- ^ The pipe character historically has been used to separate fields in the serialized version of inventory. The field is not multi-line so the newline character holds no meaning in this context.
- ^ Floating text with an alpha set to 0.0 is rendered "invisible"
- ^ The ranges in this article are written in Interval Notation.
- ^ The default values for friction and restitution depend upon the prim's material.
- ^ LINK_ROOT does not work on single prim objects!
- ^ Avatars really have 29 textures, llGetLinkNumberOfSides however returns 0 - SVC-6646[c].

