Object Types
There are 4
object types in Second Life that have
constant names:
AGENT,
ACTIVE,
PASSIVE, and
SCRIPTED. (Note that the meaning of "object type" here has no relation with
types of
values.)
When using a
function like
llDetectedType, the
return value will be an
integer with any valid object type constants
ANDed together.
AGENT indicates an
agent,
ACTIVE indicates a
physical object(
*),
PASSIVE indicates a
non-physical object and
SCRIPTED indicates the presence of a
script (though scripts in
attachments on agents don't seem to trigger this).
Agents always return
AGENT, or
AGENT &
ACTIVE when moving. Objects return
PASSIVE if they're not moving, regardless of whether or not they have physics enabled. Moving physical objects return
ACTIVE, scripted objects return
PASSIVE &
SCRIPTED, and scripted physical objects return
ACTIVE &
SCRIPTED.
| Case: | Returns AGENT: | Returns ACTIVE: | Returns PASSIVE: | Returns SCRIPTED: |
| Agent standing still | YES | NO | NO | NO |
| Agent moving | YES | YES | NO | NO |
| Agent with scripted attachments | YES | NO | NO | NO |
| Non-physical object | NO | NO | YES | NO |
| Scripted Non-physical object | NO | NO | NO | YES |
| Physical object standing still | NO | NO | YES | NO |
| Physical object moving | NO | YES | NO | NO |
| Scripted Physical object standing still | NO | NO | YES | YES |
| Scripted Physical object moving | NO | YES | NO | YES |
Since multiple values can be returned by functions relating to object type, code like this won't work:
if (llDetectedType(i) == AGENT)
So use a test like:
if (llDetectedType(i) & AGENT)
Object |
Detection