Difference between revisions of "PRIM NAME"

From Second Life Wiki
Jump to navigation Jump to search
m (added date of release)
m (<lsl> tag to <source>)
 
Line 28: Line 28:
|examples=
|examples=
These are code fragments only
These are code fragments only
<lsl>
<source lang="lsl2">
     string NameOfThisPrim = llList2String( llGetPrimitiveParams( [PRIM_NAME] ), 0);
     string NameOfThisPrim = llList2String( llGetPrimitiveParams( [PRIM_NAME] ), 0);
</lsl>
</source>
In cases like this where a list only contains one entry, we can get away with a shortcut:-
In cases like this where a list only contains one entry, we can get away with a shortcut:-
<lsl>
<source lang="lsl2">
     string NameOfThisPrim = (string) llGetPrimitiveParams( [PRIM_NAME] );
     string NameOfThisPrim = (string) llGetPrimitiveParams( [PRIM_NAME] );
</lsl>
</source>
|constants=
|constants=
|functions=
|functions=

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;