Home API Manuals About Forum
Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Back to homepage

GetLayer

Returns the equipment layer where the object with ObjID is located.

Enumerates all character layers and compares the object in each layer with ObjID.

Returns 0 if the character is disconnected or the object is not found on any layer.

Возвращает слой экипировки, на котором находится объект с ObjID.

Перебирает все слои персонажа и сравнивает объект на каждом слое с ObjID.

Возвращает 0, если персонаж не подключён или объект не найден.

Pascal

function GetLayer(ObjID: Cardinal): Byte;

Parameters:

  • ObjID — ID of the item to find on character layers.

Python

def GetLayer(ObjID: int) -> int: ...

Pascal Example

begin
  if GetLayer(shield_id) = 0 then
    AddToSystemJournal('Shield not equipped')
  else
    AddToSystemJournal('Shield is on layer ' + IntToStr(GetLayer(shield_id)));
end.

Python Example

layer = GetLayer(shield_id)
if layer == 0:
    AddToSystemJournal('Shield not equipped')
else:
    AddToSystemJournal(f'Shield is on layer {layer}')

See Also

Equip, ObjAtLayerEx, ConstantsAndEnums, Layers