I experiment with object detection and have discovered that there is a way to detect that a given object is deeded to a group. llDetectedOwner returns a NULL_KEY if the sensed object is deeded. Though llGetOwnerKey works fine for group deeded objects.
This is useful if you want to figure out the name of the owner of a detected object by its owner key... and use a dataserver request for that. The dataserver request times out if the key argument is a group key... so you cant be sure if the requested key was a group key or the request simply timed out. With the discovered feature it is possible to prevent these requests for group deeded objects.
I hope that this feature will not be fixed by the Lindens
.Can someone confirm that this isn't only a feature of the current version?
I added a detection script so that everyone can check for themselves and added a wiki note to llDetectedOwner. Probably I was somewhat quick with that. Someone may check if the added entry is fine.
http://secondlife.com/badgeo/wakka.php?wakka=llDetectedOwner
If this is a true feature that will further exist there could be also an additional note to llRequestAgentData on how to prevent timeouts by group key requests for objects discovered by llDetect*.
Regards,
Leff.
Leff.
CODE
key k;
string name;
string ownerKey;
default
{
state_entry()
{
llListen( 0, "", llGetOwner(), "" );
llSensorRemove();
}
touch_start(integer total_number)
{
}
listen( integer channel, string name, key id, string message ) {
list tokens = llParseString2List( message, [ "|" ], [ "" ] );
if ( llToLower( llList2String( tokens, 0 )) == "info" ) {
name = llList2String(tokens,1 );
if ( name != "" ) {
llOwnerSay( "Searching for '" + name + "'" );
llSensor( name, "", AGENT | ACTIVE | PASSIVE, 96, PI );
}
}
}
sensor( integer i ) {
llOwnerSay( "Number of items detected: " + (string)i );
integer idx;
for ( idx = 0; idx < i; idx ++ ) {
string name = llDetectedName( idx );
string k = llDetectedKey( idx );
ownerKey = llDetectedOwner( idx );
llRequestAgentData( ownerKey, DATA_NAME );
llOwnerSay( "Detected object: " + name + " Key: " + k );
llOwnerSay( "OwnerKey: " + ownerKey );
if ( ownerKey == NULL_KEY ) {
llOwnerSay( "Item is group owned." );
ownerKey = llGetOwnerKey( k );
llOwnerSay( "Groupkey is " + ownerKey );
} else {
llRequestAgentData( k, DATA_NAME );
}
if ( llDetectedGroup( idx ))
llOwnerSay( "Has the same group as this one." );
llOwnerSay( "Detected position: " + (string)llDetectedPos( idx ));
vector vel = llDetectedVel( idx );
if ( vel != ZERO_VECTOR )
llOwnerSay( "Detected velocity: " + (string)vel );
}
}
dataserver( key id, string agentName ) {
llOwnerSay( "Pasteable owner: [ \"" + agentName + "\",\"" + (string) ownerKey + "\"]" );
}
}