The integer constant PRIM_LINK_TARGET has the value 34
Used to get or set multiple links with a single PrimParameters call.
integer PRIM_LINK_TARGET = 34;
llSetPrimitiveParams([ PRIM_LINK_TARGET, integer link_target ]);
| integer | link_target | Link number (0: unlinked, 1: root prim, >1: child prims and seated avatars) or a LINK_* flag |
The same syntax applies to llSetLinkPrimitiveParams and llSetLinkPrimitiveParamsFast but with an additional prefixed link parameter in the function call.
llGetPrimitiveParams([ PRIM_LINK_TARGET, integer link_target ]);
Returns the list [ ]
| integer | link_target | Link number (0: unlinked, 1: root prim, >1: child prims and seated avatars) or a LINK_* flag |
The same syntax applies to llGetLinkPrimitiveParams, but with an additional prefixed link parameter in the function call.
answer = 1.0 - value. See top_size Explained for more information.llGetPrimitiveParams([PRIM_OMEGA]), the vector is normalized, and the spinrate is multiplied by the magnitude of the original vector."".[PRIM_TYPE_BOX, PRIM_HOLE_DEFAULT, <0., 1., 0.>, 0., ZERO_VECTOR, <1., 1., 0.>, ZERO_VECTOR][<0., 1., 0.>]PRIM_MATERIAL_FLESH.FALSE.FALSE.llGetAgentSize(llGetLinkKey(link)).["", ZERO_VECTOR, 1.].[FALSE, ZERO_VECTOR, 0., 0., 0.].[FALSE, 0, 0., 0., 0., 0., ZERO_VECTOR].[] and report a script error to the owner: "texture info cannot be accessed for avatars."default
{
touch_start(integer num_detected)
{
// color the root prim red and the first linked-prim green
llSetLinkPrimitiveParamsFast(LINK_ROOT,
[PRIM_COLOR, ALL_SIDES, <1.0, 0.0, 0.0>, (float)TRUE,
PRIM_LINK_TARGET, 2,
PRIM_COLOR, ALL_SIDES, <0.0, 1.0, 0.0>, (float)TRUE]);
// instead of:
// llSetLinkPrimitiveParamsFast(LINK_ROOT,
// [PRIM_COLOR, ALL_SIDES, <1.0, 0.0, 0.0>, (float)TRUE]);
// llSetLinkPrimitiveParamsFast(2,
// [PRIM_COLOR, ALL_SIDES, <0.0, 1.0, 0.0>, (float)TRUE]);
}
}
// assume that you have a global list "gPanels" loaded with the link numbers of prims
// named "panel" and that the global integer parameter "gON" has been defined ....
touch_start(integer num)
{
// basic on/off switch
gON = !gON;
// conditions which will change on touch
// white panel
list WhichWay = [PRIM_COLOR, ALL_SIDES, <1.0, 1.0, 1.0>, (float)TRUE];
if (gON)// red panel
WhichWay = [PRIM_COLOR, ALL_SIDES, <1.0, 0.0, 0.0>, (float)TRUE];
// to accumulate the parameter list that will be affected by SLPPF in this event
list params;
integer numberOfPrims = llGetNumberOfPrims();
// Links in a linkset start numbering with 1
integer index = 1;
do
{
// build the parameters list, in the format PRIM_LINK_TARGET, link number, parameters
params += [PRIM_LINK_TARGET, llList2Integer(gPanels, index)] + WhichWay;
}
while (++index < numberOfPrims);
// apply the parameters to all "panel" prims
llSetLinkPrimitiveParamsFast(LINK_SET, params);
}
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.
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 all avatars first.
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.
If a script located in a child prim erroneously attempts to access link 0, it will get or set the property of the linkset's root prim. This bug (BUG-5049) is preserved for broken legacy scripts.
|
|
||||||||||||
PRIM_TYPE top_size and client taper conversion
| Range | 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 |
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.