Difference between revisions of "PRIM NAME"

From Second Life Wiki
Jump to navigation Jump to search
m (Updated with the actual constant value from a running 1.40 server.)
m (<lsl> tag to <source>)
 
(10 intermediate revisions by 4 users not shown)
Line 1: Line 1:
<onlyinclude>{{#if:
<onlyinclude>{{#if:


{{#vardefine:name_const|{{LSL Const|PRIM_NAME|integer||c=Used to {{GetSet|{{{1|}}}|get|set|/}} the prim's name}}}}
{{#vardefine:name_const|{{LSL Const|PRIM_NAME|integer|27|c=Used to {{GetSet|{{{1|}}}|get|set|/}} the prim's name}}}}


}}</onlyinclude>{{#if:
}}</onlyinclude>{{#if:


}}{{LSL Constant
}}{{LSL Constant
|inject-1={{LSL Generic/pre-release|server-release=1.40}}
|inject-2={{LSL PrimitiveParam Categorize|Prim}}
|name=PRIM_NAME
|name=PRIM_NAME
|type=integer
|type=integer
Line 13: Line 13:
|pa={{LSL Constant/List|i_front=[[llSetPrimitiveParams]]([&#32;{{#var:name_const}},&#32;|i_end=&nbsp;]);
|pa={{LSL Constant/List|i_front=[[llSetPrimitiveParams]]([&#32;{{#var:name_const}},&#32;|i_end=&nbsp;]);
|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]]([&nbsp;{{#var:name_const}}|i_end=&nbsp;]);|
|pb={{LSL Constant/List|i_front=[[llGetPrimitiveParams]]([&nbsp;{{#var:name_const}}|i_end=&nbsp;]);|
|r_front=Returns the list [&nbsp;|r_end=&nbsp;]
|r_front=Returns the list [&nbsp;|r_end=&nbsp;]
|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
}}
}}
|examples=
|examples=
These are code fragments only
<source lang="lsl2">
    string NameOfThisPrim = llList2String( llGetPrimitiveParams( [PRIM_NAME] ), 0);
</source>
In cases like this where a list only contains one entry, we can get away with a shortcut:-
<source lang="lsl2">
    string NameOfThisPrim = (string) llGetPrimitiveParams( [PRIM_NAME] );
</source>
|constants=
|constants=
|functions=
|functions=
Line 32: Line 44:
{{LSL DefineRow||[[llGetObjectName]]|}}
{{LSL DefineRow||[[llGetObjectName]]|}}
{{LSL DefineRow||[[llSetObjectName]]|}}
{{LSL DefineRow||[[llSetObjectName]]|}}
{{LSL DefineRow||[[llGetLinkName]]|}}
|events
|events
|location
|location
|cat1=Prim
|cat1=Legacy Name<!--only in this category because of llGetLinkPrimitiveParams and seated avatars-->
|cat2=PrimitiveParams
|cat2
|cat3
|history = *Date of release [[ Release_Notes/Second_Life_Server/1.38#New_Features | 29-03-2010 ]]
|cat4
}}
}}

Latest revision as of 15:45, 23 January 2015

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


Examples

These are code fragments only

    string NameOfThisPrim = llList2String( llGetPrimitiveParams( [PRIM_NAME] ), 0);

In cases like this where a list only contains one entry, we can get away with a shortcut:-

    string NameOfThisPrim = (string) llGetPrimitiveParams( [PRIM_NAME] );

Deep Notes

History

Search JIRA for related Issues

Signature

integer PRIM_NAME = 27;