LlGetObjectDetails/ru

From Second Life Wiki
Jump to navigation Jump to search

Общая информация

Function: list llGetObjectDetails( key id, list params );

Возвращает список атрибутов объекта/аватара с ключом id, обозначенных в списке params.

• key id group, avatar or prim UUID that is in the same region or adjacent regions*
• list params OBJECT_* flags

Если id не найден, возвращает пустой список. Если в params задан неправильный целочисленный параметр, возвращает OBJECT_UNKNOWN_DETAIL.

Характеристики

Avatar detection range for SL Server 1.34
Параметр id

id содержит уникальный ключ аватара или примитива, атрибуты которого функция должна возвратить.

Если id не найден в регионе, производится поиск аватаров в соседних регионах. Аватар считается найденным, если он находится в регионе или в зоне шириной 34 метра в соседнем регионе (жёлтая зона на рисунке). Когда аватар покидает эту зону, функция может вернуть только одно соответствующее действительности (последнее) значение.

Параметр params

Список params отражает атрибуты, которые требуется получить. Порядок, в котором они заданы в этом списке, соответствует порядку их в возвращаемом функцией списке.

  • Если в params содержатся недопустимые целочисленные параметры, в соответствующих местах в возвращаемом списке ставится OBJECT_UNKNOWN_DETAIL .
  • Если в params содержатся не целочисленные параметры, они игнорируются (без сообщений об ошибке).

Flags Description Length when typecast to a string Return Alternatives Local
OBJECT_NAME 1 Gets the prim's name.
If id is an avatar, the Legacy Name is returned.
max. 63 characters string name llGetObjectName
OBJECT_DESC 2 Gets the prim's description.
If id is an avatar, an empty string is returned.
max. 127 characters string desc llGetObjectDesc
OBJECT_POS 3 Gets the prim's position in region coordinates.
If id is an avatar outside the region (see above), this position is relative to the region the script is running in.
max. 37 characters vector pos llGetPos
OBJECT_ROT 4 Gets the prim's rotation. max. 48 characters rotation rot llGetRot
OBJECT_VELOCITY 5 Gets the object's velocity. 36 characters vector vel llGetVel
OBJECT_OWNER 6 Gets an object's owner key.
If id is an avatar, that avatar's key is returned (which is the same as id).
If id is group-owned, a NULL_KEY is returned.
36 characters key owner llGetOwner
OBJECT_GROUP 7 Gets the prim's group key.
If id is an avatar, a NULL_KEY is returned.[1]
36 characters key group Group
OBJECT_CREATOR 8 Gets the prim's creator key.
If id is an avatar, a NULL_KEY is returned.
36 characters key creator Creator llGetCreator
OBJECT_RUNNING_SCRIPT_COUNT 9 Gets the number of running scripts attached to the object or agent. max. 11 characters integer count llGetScriptState
OBJECT_TOTAL_SCRIPT_COUNT 10 Gets the number of scripts, both running and stopped, attached to the object or agent. max. 11 characters integer count llGetInventoryNumber
OBJECT_SCRIPT_MEMORY 11 Gets the total amount of script memory allocated to the object or agent, in bytes. See page for more info. max. 11 characters integer bytes
OBJECT_SCRIPT_TIME 12 Gets the total amount of average script CPU time used by the object or agent, in seconds. See page for more info. max. 15 characters float seconds Top Scripts
OBJECT_PRIM_EQUIVALENCE 13 Gets the prim equivalence of the object. max. 11 characters integer count Calculating land impact
OBJECT_SERVER_COST 14 Gets the server cost of the object. max. 15 characters float cost Server cost
OBJECT_STREAMING_COST 15 Gets the streaming (download) cost of the object. max. 15 characters float cost Streaming (download) cost
OBJECT_PHYSICS_COST 16 Gets the physics cost of the object. max. 15 characters float cost Physics cost
OBJECT_CHARACTER_TIME 17 Gets the average CPU time (in seconds) used by the object for navigation, if the object is a pathfinding character. Returns 0 for non-characters. max. 15 characters float seconds Pathfinding characters
OBJECT_ROOT 18 Gets the id of the root prim of the object requested.
If id is an avatar, returns the id of the root prim of the linkset the avatar is sitting on and linked to (or the avatar's own id if the avatar is not sitting on an object within the region).
36 characters key root llGetLinkKey
OBJECT_ATTACHED_POINT 19 Gets the attachment point to which the object is attached. It returns an integer matching one of the ATTACH_* constants. max. 11 characters integer attach_point llGetAttached
OBJECT_PATHFINDING_TYPE 20 Gets the pathfinding setting of the object in the region. It returns an integer matching one of the OPT_* constants. max. 11 characters integer type Pathfinding types
OBJECT_PHYSICS 21 Gets the integer boolean detailing if physics is enabled or disabled on the object.
If id is an avatar or attachment, 0 is returned.
1 character integer boolean llGetStatus PRIM_PHYSICS
OBJECT_PHANTOM 22 Gets the integer boolean detailing if phantom is enabled or disabled on the object.
If id is an avatar or attachment, 0 is returned.
1 character integer boolean llGetStatus PRIM_PHANTOM
OBJECT_TEMP_ON_REZ 23 Gets the integer boolean detailing if temporary is enabled or disabled on the object. 1 character integer boolean PRIM_TEMP_ON_REZ
OBJECT_RENDER_WEIGHT 24 Gets the avatar's render weight.
If id is an object, 0 is returned. If id is an avatar whose render weight is unknown to the simulator, -1 is returned. The maximum render weight reported by the server is 500000[1].
max. 6 characters integer weight Avatar_Rendering_Cost
OBJECT_HOVER_HEIGHT 25 Gets the hover height of the avatar.
If id is not an avatar, 0.0 is returned. Normal values are in the range [-2.0, 2.0] with a default of 0.0. This value does not reflect the avatar shape's "Hover" slider, only the dynamic viewer setting.
max. 9 characters float height
OBJECT_BODY_SHAPE_TYPE 26 Gets a float which describes the sex setting of the avatar's currently worn shape.
If id is not an avatar, -1.0 is returned.
Normal operational values are in the range [0.0, 1.0].
  • 0.0 is standard female setting,
  • 1.0 is standard male setting.

Intermediate values with visible differences are possible with manually crafted shapes.

max. 9 characters float shape
OBJECT_LAST_OWNER_ID 27 Gets the UUID of the object's previous owner, if known.
  • For group-owned objects, this is the avatar that deeded the object.
  • Returns NULL_KEY for avatars, or objects that were never transferred.
  • A rezzed object taken back to inventory, then re-rezzed, will return its current owner key.
36 characters key last_owner
OBJECT_CLICK_ACTION 28 Gets the click action of the prim. It returns an integer matching one of the CLICK_ACTION_* constants. max. 3 characters integer action
OBJECT_OMEGA 29 Gets the object's rotational velocity (radians per second). 36 characters vector omega llGetOmega
OBJECT_PRIM_COUNT 30 Gets the object's prim count max. 3 characters integer count llGetObjectPrimCount llGetNumberOfPrims
OBJECT_TOTAL_INVENTORY_COUNT 31 Gets the object's total number of inventory items. max. 10 characters integer count llGetInventoryNumber(INVENTORY_ALL)
OBJECT_REZZER_KEY 32 Gets the key of the object that rezzed this object be it an object or an avatar. 36 characters key rezzer
OBJECT_GROUP_TAG 33 Gets the avatar's group tag text.
If id is not an avatar, an empty string is returned.
max. 20 bytes string text
OBJECT_TEMP_ATTACHED 34 Gets the integer boolean detailing if the object is temporarily attached. 1 character integer boolean
OBJECT_ATTACHED_SLOTS_AVAILABLE 35 Gets the avatar's available attachment slot count.
If id is not an avatar, 0 is returned.
max. 2 characters integer count
OBJECT_CREATION_TIME 36 Gets the object's creation time. This time is established with raw material rezzing through the build menu and with mesh uploads.
This time is NOT established with inventory rezzes, scripted rezzes, object modifying, copying or transferring.
If id is an avatar, an empty string is returned.
max. 27 bytes string timestamp
OBJECT_SELECT_COUNT 37 Gets the total number of agents selecting any links in the object.
If id is an avatar, 0 is returned.
max. 3 characters integer count
OBJECT_SIT_COUNT 38 Gets the total number of agents sitting on any links in the object.
If id is an avatar, 0 is returned.
max. 3 characters integer count
OBJECT_ANIMATED_COUNT 39 Gets the integer boolean detailing if the object's root is set to "Animated Mesh" or gets the total number of "Animated Mesh" attachments worn by an agent. max. 1 character integer count
OBJECT_ANIMATED_SLOTS_AVAILABLE 40 Gets the avatar's available "Animated Mesh" attachment slot count.
If id is not an avatar, 0 is returned.
max. 2 characters integer count
OBJECT_ACCOUNT_LEVEL 41 Gets the account level of an avatar.
If id is not an avatar, -1 is returned.
  • 0 is Basic account level.
  • 1 is Premium account level.
  • 5 is Plus account level.
  • 10 is Premium Plus account level.
max. 1 character integer level
OBJECT_MATERIAL 42 Retrieves the physics material set on this object. It returns an integer matching one of the PRIM_MATERIAL_* constants. integer material llGetPrimitiveParams
PRIM_MATERIAL
OBJECT_MASS 43 Gets the mass (in Kilograms) of this object's linkset. float mass llGetMassMKS
OBJECT_TEXT 44 Gets the floating text displayed above this object. string text llGetPrimitiveParams
PRIM_TEXT
OBJECT_REZ_TIME 45 Retrieves the time that this object was rezzed. string time
OBJECT_LINK_NUMBER 46 Get this object's index in the linkset. integer link_number llGetLinkNumber
OBJECT_SCALE 47 Get the size of this object. vector scale llGetScale
OBJECT_TEXT_COLOR 48 Gets the color of the floating text displayed above this object. vector color llGetPrimitiveParams
PRIM_TEXT
OBJECT_TEXT_ALPHA 49 Gets the alpha value of the floating text displayed above this object. float alpha llGetPrimitiveParams
PRIM_TEXT
OBJECT_HEALTH 50 Retrieves the health of an avatar or prim. float health llGetPrimitiveParams
PRIM_HEALTH

llGetHealth

OBJECT_DAMAGE 51 Retrieves the amount of damage a prim inflicts on collision. float damage llGetPrimitiveParams
PRIM_DAMAGE
OBJECT_DAMAGE_TYPE 52 Retrieves the type of damage a prim inflicts on collision. It returns an integer that can match one of the DAMAGE_TYPE_* constants, be a custom damage type or be repurposed by a combat system. integer damage_type llGetPrimitiveParams
PRIM_DAMAGE

Предостережения

  • OBJECT_ROT возвращает точное значение поворота для аватара, когда он сидит или находится в режиме 1-го лица (мауслук). В остальных случаях это значение приблизительное.
  • В отличие от аватаров, поиск примитивов в соседних регионах не производится.
  • Информация об аватарах, которые не могут быть обнаружены, доступна на протяжении небольшого периода времени (около 45 секунд), и она не обновляется.
  • Параметры в списке params, не являющиеся целочисленными, игнорируются, OBJECT_UNKNOWN_DETAIL в соответствующем месте в возвращаемом списке не ставится.
  • Эта функция неприменима к вещам в инвентаре.
  • llTargetOmega влияет на параметр OBJECT_ROT только если объект физический. Иначе возвращается изначальный поворот объекта, т.к. llTargetOmega для нефизических объектов является клиентским эффектом.
  • OBJECT_SCRIPT_MEMORY сообщает максимальный объём памяти, которые могут использовать скрипты в данном объекте, а не действительный потребляемый на данный момент объём. Скрипты, работающие под Mono, используют только необходимое им количество памяти, а не максимально возможное. На практике, этот параметр показывает, сколько памяти в наихудшем случае будут потреблять скрипты. На самом деле, практически всегда они потребляют объём памяти меньше этого показателя.
  • OBJECT_RUNNING_SCRIPT_COUNT включает в себя и зависшие скрипты тоже (т.е. скрипты, чья работа была прервана вследствие ошибки).

Примеры

<lsl>default {

   collision_start(integer i)
   {
       list a = llGetObjectDetails(llDetectedKey(0), ([OBJECT_NAME, 
                   OBJECT_DESC, OBJECT_POS, OBJECT_ROT, OBJECT_VELOCITY,
                   OBJECT_OWNER, OBJECT_GROUP, OBJECT_CREATOR]));
       llWhisper(0,"UUID: "         + (string)llDetectedKey(0) +
                 "\nName: \""       + llList2String(a,0) + "\"" +
                 "\nDescription: \"" + llList2String(a,1) + "\"" +
                 "\nPosition: "     + llList2String(a,2) +
                 "\nRotation: "     + llList2String(a,3) +
                 "\nVelocity: "     + llList2String(a,4) +
                 "\nOwner: "        + llList2String(a,5) +
                 "\nGroup: "        + llList2String(a,6) +
                 "\nCreator: "      + llList2String(a,7));
   }

}</lsl> <lsl>// Group join inviter default {

   touch_start(integer num_detected)
   {
       llInstantMessage(llDetectedKey(0),"Click on Join in my group profile:\n" +
           " secondlife:///app/group/" + llList2String(llGetObjectDetails(llGetKey(), [OBJECT_GROUP]), 0) + "/about ");
   }

}</lsl> <lsl>// aim & shoot default { state_entry()

   {   llRequestPermissions(llGetOwner(), PERMISSION_TAKE_CONTROLS);
   }
   control(key id, integer pressed, integer change) 
   {   if(change & pressed & CONTROL_ML_LBUTTON)
llSensor("", "", AGENT

Полезные вырезки

На странице Link/Get Вы найдёте полезные функции, касающиеся связанных объектов. Также обратите внимане на функцию llGetLinkPrimitiveParams, если вам нужно получить позицию и поворот примитива в связанном объекте.

См. также

Функции

•  llKey2Name
•  llGetPrimitiveParams
•  llSetLinkPrimitiveParams
•  llSetPrimitiveParams
•  llGetParcelDetails

Статьи

•  Limits SL limits and constrictions
•  Detected
•  Prim Attribute Overloading

Углублённые заметки

История

Introduced in SL 1.18.3(2)

All Issues

~ Search JIRA for related Issues
   OBJECT_DISPLAY_NAME and OBJECT_USERNAME to llGetObjectDetails()
   [Won't Fix] OBJECT_RUNNING_SCRIPT_COUNT includes the crashed scripts in the count of running scripts.

Сноски

  1. ^ There are at least 3 JIRA's about OBJECT_GROUP and avatars, LL has refused all of them. Most recently on December 5th 2013 in BUG-4654.
  2. ^ Математические промежутки описаны в статье [1].
  1. On July 2016, Rolig Loon commented on the talk page for llGetObjectDetails() that allegedly SL viewers are showing render weights of 1,300,000.

Описания

function list llGetObjectDetails( key id, list params );