Difference between revisions of "GetOwner"

From the Oblivion ConstructionSet Wiki
Jump to navigation Jump to search
imported>Haama
(→‎Notes: Added IsOfflimits)
imported>Bruneauinfo
m (Added a new top note)
 
(One intermediate revision by one other user not shown)
Line 4: Line 4:
  (owner:ref) reference.GetOwner
  (owner:ref) reference.GetOwner


Returns the NPC or faction which owns the calling reference.
Returns the NPC or faction which owns the calling reference.  


==Notes==
==Notes==
*GetOwner does not appear to work on activators such as switches and doors.
*The ownership of an item can also be determined by the cell owner. If the cell has a set [[Interior_cells#Interior Data:|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
*The ownership of an item can also be determined by the cell owner. If the cell has a set [[Interior_cells#Interior Data:|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
<pre>ref pOwner
<pre>ref pOwner
Line 23: Line 24:
*[[GetOwningFactionRequiredRank]]
*[[GetOwningFactionRequiredRank]]
*[[GetParentCellOwningFactionRequiredRank]]
*[[GetParentCellOwningFactionRequiredRank]]
*[[IsOffLimits]]


[[Category: Functions]]
[[Category: Functions]]

Latest revision as of 12:40, 13 December 2010

A command for Oblivion Script Extender

Syntax:

(owner:ref) reference.GetOwner

Returns the NPC or faction which owns the calling reference.

Notes[edit | edit source]

  • GetOwner does not appear to work on activators such as switches and doors.
  • 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[edit | edit source]