Difference between revisions of "LlGetObjectPrimCount"

From Second Life Wiki
Jump to navigation Jump to search
m (add cat Object)
Line 2: Line 2:
|func_id=323|func_sleep=0.0|func_energy=10.0
|func_id=323|func_sleep=0.0|func_energy=10.0
|func=llGetObjectPrimCount
|func=llGetObjectPrimCount
|return_type=integer|p1_type=key|p1_name=object_id
|return_type=integer|p1_type=key|p1_name=prim
|func_footnote
|func_footnote
|func_desc
|func_desc
|return_text=that is the total number of prims for an object in the sim.
|return_text=that is the total number of prims for an object in the sim that contains '''prim'''.
|spec
|spec
|caveats
|caveats=
'''object_id'''
*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=
<lsl>
<lsl>default{
default{
   touch_start( integer vIntTouched ){
   touch_start( integer vIntTouched ){
    integer prims = llGetObjectPrimCount( llGetKey() );
     llSay( PUBLIC_CHANNEL, "This object has "
     llSay( PUBLIC_CHANNEL, "This object has "
                           + (string)llGetObjectPrimCount( llGetKey() )
                           + (string)prims
                           + " prims" );
                           + " prims and "
    //-- llGetObjectPrimCount( llGetKey() ) is equavalent to
                          + (string)(llGetNumberOfPrims() - prims)
    //-- LlGetNumberOfPrims(), with the option to use it for
                          + " avatars.");
    //-- any object you have a key for.
   }
   }
}
}</lsl>
</lsl>
|helpers
|helpers
|also_functions=
|also_functions=
{{LSL DefineRow||{{LSLG|llGetNumberOfPrims}}|Returns the number of prims in the current object.}}
{{LSL DefineRow||[[llGetNumberOfPrims]]|Returns the number of prims in the current object.}}
|also_tests
|also_tests
|also_events
|also_events

Revision as of 08:24, 16 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

Caveats

object_id

  • 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).
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>

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 );