HasSameEditorLocAsRef

From the CreationKit Wiki
Jump to navigation Jump to search

Description[edit | edit source]

HasSameEditorLocAsRef returns 1 if the two refs' Editor Locations are the same Location, or their editor locations have a parent location matching the (optional) Keyword.

The keyword is used to essentially define which "level" of location to test. For example, if two actors' editor locations are each a different interior (their houses), and each of the their houses are attached to locations that have the same parent location (a town), then passing a keyword associated with that parent location (such as LocTypeTown), it will return true.

Not passing the keyword tests against the immediate location of the cell each reference is placed in the render window of the editor (in other words, it doesn't care if they share any of same parent locations).

Usually you will be supplying a keyword that helps define the "range" of the location you are looking at, above the particular immediate location the reference is placed. For example, are these two references in the same dungeon, or town, or Hold, rather than are these two reference in the same house, or room.

Note: When used as a condition when filling Location Alias, it will be filled with a location having the keyword type and that is (or is the parent location of) the parameter reference's editor location.

Syntax[edit | edit source]

[ObjectREF.]HasSameEditorLocAsRef OtherRef LocationKeyword

Examples[edit | edit source]

player.HasSameEditorLocAsRef AlvorRef     ; returns true if both player and AlvorRef have the same editor location
player.HasSameEditorLocAsRef AlvorRef LocTypeCity      ; returns true if both player and AlvorRef have editor locations in a cell in a location that has the keyword LocTypeCity (or has the same parent location which does).

See Also[edit | edit source]

Reference[edit | edit source]

Papyrus Version[edit | edit source]

GetEditorLocation - ObjectReference
HasCommonParent - Location