Don't click here unless you want to be banned.

LSL Wiki : llGetObjectDetails

HomePage :: PageIndex :: RecentChanges :: RecentlyCommented :: UserSettings :: You are ec2-54-89-10-19.compute-1.amazonaws.com
list llGetObjectDetails(key id, list params)

Returns details of the object with the key id specified in the params list.
The details are returned inside a list in the same order as the parameters are given. The value OBJECT_UNKNOWN_DETAIL is returned inside the list for an unknown parameter given.

Notes:

Parameters

Query List Entry Type Object Application Agent Application
OBJECT_NAME string Returns object name. Similar to llKey2Name Returns agent name. Similar to llKey2Name
OBJECT_DESC string Returns object description. Returns empty string.
OBJECT_POS vector Returns object position. Returns agent position.
OBJECT_ROT rotation Returns object rotation. Returns agent rotation.
OBJECT_VELOCITY vector Returns object velocity. Returns agent velocity.
OBJECT_OWNER key Returns the key of the object owner.
Returns NULL_KEY if deeded to a group.
Returns agent key (identical to input key id)
OBJECT_GROUP key Returns the key of the object's set group. Returns NULL_KEY.
OBJECT_CREATOR key Returns the key of the object creator. Returns NULL_KEY.
OBJECT_RUNNING_SCRIPT_COUNT integer Returns the number of running scripts on the object. Returns the number of running scripts inside all of the agent's attachments.
OBJECT_TOTAL_SCRIPT_COUNT integer Returns the total number of scripts, running or not, on the object. Returns the total number of scripts, running or not, inside all of the agent's attachments.
OBJECT_SCRIPT_MEMORY integer Returns the maximum script memory that might be used by the object. Returns the maximum script memory that might be used by all of the agent's attachments.

Example:
list params = llGetObjectDetails(id, [OBJECT_NAME, OBJECT_POS, OBJECT_OWNER]);

A Better Example (it should be noted that this example will stop working when SVC-774 is implemented):
//A script that will, in an object, follow someone if they teleport - 
//and report back to you where they went (in global co-ords it goes and gets them, even on islands). 
//Using a hack in llGetObjectDetails.

//This script was made by some sandbox goers when llGetObjectDetails first came out. 
//This is actually derived from Jana Kamachi's version of the sandbox script 
//(although she is not the original script's creator) - messed around with by yours truely ;)

list    keys = [];
vector  last = <0,0,0>;

default
{
        state_entry(){
                llListen(3,"",llGetOwner(),"");
                llSensorRepeat("",NULL_KEY,AGENT,96,PI*2,1);
                llSetTimerEvent(0.00001);
        }

        timer(){
                integer i=0;
                list    temp;
                vector  raw;

                @home;
                for(i=0;i<llGetListLength(keys);i++){
                        temp = llGetObjectDetails(llList2Key(keys,i),[OBJECT_POS]);
                        raw  = llList2Vector(temp,0);
                        if((raw.x > 256 || raw.x < 0) || (raw.y > 256 || raw.y <0)){
                                llOwnerSay(llKey2Name(llList2Key(keys,i)) + " has left the sim to " + (string)raw);
                                last = raw;
                                keys = llDeleteSubList(keys,i,0);
                                jump home;
                        }
                }
        }

        sensor(integer n_m){
                integer i=0;
                for(i=0;i<n_m;i++){
                        if(llListFindList(keys,[llDetectedKey(i)])==-1){
                                keys+=[llDetectedKey(i)];
                                llOwnerSay("Indexed: " + llKey2Name(llDetectedKey(i)));
                        }
                }
        }

        changed(integer c){
                if(c  == CHANGED_TELEPORT){
                        keys = [];
                }
        }

        touch_start(integer n_m){
                llMapDestination(llGetRegionName(),last,<0,0,0>);
        }

        listen(integer c, string name, key id, string msg){
                llMapDestination(llGetRegionName(),(vector)msg,<0,0,0>);
        }
}
- Tre Giles


Functions | Object
There are 17 comments on this page. [Display comments/form]