GetOwner

From the Oblivion ConstructionSet Wiki
Revision as of 03:24, 27 January 2008 by imported>Haama (→‎See Also: Added IsOffLimits)
Jump to navigation Jump to search

A command for Oblivion Script Extender

Syntax:

(owner:ref) reference.GetOwner

Returns the NPC or faction which owns the calling reference.

Notes

  • The ownership of an item can also be determined by the cell owner. If the cell has a set Owner NPC, all items in the cell are owned by the NPC. In that case, this function may return 0, but GetParentCellOwner will return the true owner. In code
ref pOwner
...
set pOwner to SomeRef.GetOwner
if (pOwner == 0)
  set pOwner to SomeRef.GetParentCellOwner
endif
if pOwner
...
  • The returned ownerID seems to be a base ObjectID, and it should be used in the objectID position of any other function.
  • If you want to know if an actor owns an item or can legally activate it, use IsOffLimits instead.

See Also