Difference between revisions of "PRIM NAME"
Jump to navigation
Jump to search
Omei Qunhua (talk | contribs) (Provide example) |
m |
||
Line 13: | Line 13: | ||
|pa={{LSL Constant/List|i_front=[[llSetPrimitiveParams]]([ {{#var:name_const}}, |i_end= ]); | |pa={{LSL Constant/List|i_front=[[llSetPrimitiveParams]]([ {{#var:name_const}}, |i_end= ]); | ||
|text={{LSL Constant/PrimParamText|set}} | |text={{LSL Constant/PrimParamText|set}} | ||
There is no '''llSetLinkName''' function, using this flag this way fills that niche. | |||
|i1_type=string|i1_name=name | |i1_type=string|i1_name=name | ||
|toc=llSetPrimitiveParams | |toc=llSetPrimitiveParams | ||
Line 18: | Line 20: | ||
|pb={{LSL Constant/List|i_front=[[llGetPrimitiveParams]]([ {{#var:name_const}}|i_end= ]);| | |pb={{LSL Constant/List|i_front=[[llGetPrimitiveParams]]([ {{#var:name_const}}|i_end= ]);| | ||
|r_front=Returns the list [ |r_end= ] | |r_front=Returns the list [ |r_end= ] | ||
|text={{LSL Constant/PrimParamText|get}} | |text={{LSL Constant/PrimParamText|get}}{{PBR}} | ||
If {{LSLGC|Parameters/link|link}} refers to an avatar (seated avatars are assigned link numbers), the avatar's {{LSLGC|Legacy Name|legacy name}} is returned. | |||
|r1_type=string|r1_name=name | |r1_type=string|r1_name=name | ||
|toc=llGetPrimitiveParams | |toc=llGetPrimitiveParams | ||
Line 40: | Line 44: | ||
{{LSL DefineRow||[[llGetObjectName]]|}} | {{LSL DefineRow||[[llGetObjectName]]|}} | ||
{{LSL DefineRow||[[llSetObjectName]]|}} | {{LSL DefineRow||[[llSetObjectName]]|}} | ||
{{LSL DefineRow||[[llGetLinkName]]|}} | |||
|events | |events | ||
|location | |location |
Revision as of 23:45, 24 December 2013
LSL Portal | Functions | Events | Types | Operators | Constants | Flow Control | Script Library | Categorized Library | Tutorials |
Description
Constant: integer PRIM_NAME = 27;The integer constant PRIM_NAME has the value 27
Used to get or set the prim's name.
llSetPrimitiveParams
llSetPrimitiveParams([ PRIM_NAME, string name ]);• string | name |
The same syntax applies to llSetLinkPrimitiveParams and llSetLinkPrimitiveParamsFast but with an additional prefixed link parameter in the function call.
There is no llSetLinkName function, using this flag this way fills that niche.
llGetPrimitiveParams
llGetPrimitiveParams([ PRIM_NAME ]);Returns the list [ string name ]
• string | name |
The same syntax applies to llGetLinkPrimitiveParams, but with an additional prefixed link parameter in the function call.
If link refers to an avatar (seated avatars are assigned link numbers), the avatar's legacy name is returned.
Caveats
Related Articles
Examples
These are code fragments only <lsl>
string NameOfThisPrim = llList2String( llGetPrimitiveParams( [PRIM_NAME] ), 0);
</lsl> In cases like this where a list only contains one entry, we can get away with a shortcut:- <lsl>
string NameOfThisPrim = (string) llGetPrimitiveParams( [PRIM_NAME] );
</lsl>