LlGetObjectPrimCount

From Second Life Wiki

Jump to: navigation, search

Template:Needs Translation/LSL/de Template:Needs Translation/LSL/es Template:Needs Translation/LSL/el Template:Needs Translation/LSL/he Template:Needs Translation/LSL/it Template:Needs Translation/LSL/ko Template:Needs Translation/LSL/nl Template:Needs Translation/LSL/hu Template:Needs Translation/LSL/no Template:Needs Translation/LSL/da Template:Needs Translation/LSL/sv Template:Needs Translation/LSL/tr Template:Needs Translation/LSL/pl Template:Needs Translation/LSL/pt Template:Needs Translation/LSL/ru Template:Needs Translation/LSL/uk Template:Needs Translation/LSL/zh-Hans Template:Needs Translation/LSL/zh-Hant

Contents

Summary

Function: integer llGetObjectPrimCount( key prim );
323 Function ID
0.0 Delay
10.0 Energy

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

• key prim Must be the UUID of a prim in the sim otherwise the return is zero.

Avatars are not counted.

Caveats

  • This cannot be used to detect if an avatar is seated, use llGetAgentInfo instead.

Search JIRA for related Bugs

Examples

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

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 maybe a better choice.

See Also

Functions

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

Deep Notes

This article wasn't helpful for you? Maybe the related article at the LSL Wiki is able to bring enlightenment.
In other languages