Difference between revisions of "LlGetObjectPrimCount"

From Second Life Wiki
Jump to navigation Jump to search
m
m
Line 3: Line 3:
|func=llGetObjectPrimCount
|func=llGetObjectPrimCount
|return_type=integer|p1_type=key|p1_name=prim
|return_type=integer|p1_type=key|p1_name=prim
|func_footnote
|func_footnote=If '''prim''' is not the key of a prim in the sim, then the return is zero. Avatars are not counted.
|func_desc
|func_desc
|return_text=that is the total number of prims for an object in the sim that contains '''prim'''.
|return_text=that is the total number of prims for an object in the sim that contains '''prim'''.
|spec
|spec
|caveats=
|caveats=
'''object_id'''
*This cannot be used to detect if an avatar is seated, use [[llGetAgentInfo]] instead.
*Avatars are not counted as prims, this is contrary to how [[llGetNumberOfPrims]] works.
*Does not work on avatars, always returns zero; this cannot be used to detect if an avatar is seated, use [[llGetAgentInfo]] instead.
|constants
|constants
|examples=
|examples=
Line 29: Line 27:
|also_events
|also_events
|also_articles
|also_articles
|notes
|notes=
[[llGetObjectPrimCount]] can be used as an alternative for [[llGetAgentSize]] for testing if a uuid that is known to be in the sim is an avatar. The big difference being the two is that [[llGetObjectPrimCount]] returns zero on avatars while [[llGetAgentSize]] returns [[ZERO_VECTOR]] on prims. These two could be used in conjunction to test if the uuid is in the sim but [[llGetBoundingBox]] mayb be a better choice.
|cat1=Object
|cat1=Object
|cat2
|cat2

Revision as of 01:38, 18 August 2008

Summary

Function: integer llGetObjectPrimCount( key prim );

Returns an integer that is the total number of prims for an object in the sim that contains prim.

• key prim

If prim is not the key of a prim in the sim, then the return is zero. Avatars are not counted.

Caveats

  • This cannot be used to detect if an avatar is seated, use llGetAgentInfo instead.
All Issues ~ Search JIRA for related Bugs

Examples

<lsl>default{

 touch_start( integer vIntTouched ){
   integer prims = llGetObjectPrimCount( llGetKey() );
   llSay( PUBLIC_CHANNEL, "This object has "
                          + (string)prims
                          + " prims and "
                          + (string)(llGetNumberOfPrims() - prims)
                          + " avatars.");
 }
}</lsl>

Notes

llGetObjectPrimCount can be used as an alternative for llGetAgentSize for testing if a uuid that is known to be in the sim is an avatar. The big difference being the two is that llGetObjectPrimCount returns zero on avatars while llGetAgentSize returns ZERO_VECTOR on prims. These two could be used in conjunction to test if the uuid is in the sim but llGetBoundingBox mayb be a better choice.

See Also

Functions

•  llGetNumberOfPrims Returns the number of prims in the current object.

Deep Notes

Search JIRA for related Issues

Signature

function integer llGetObjectPrimCount( key prim );