GetCurrentLocation - ObjectReference

From the Fallout4 CreationKit Wiki
Jump to navigation Jump to search

Member of: ObjectReference Script

Obtains this reference's current Location.

Syntax[edit | edit source]

Location Function GetCurrentLocation() native

Parameters[edit | edit source]

None.

Return Value[edit | edit source]

This reference's current Location.

Examples[edit | edit source]

; Is this object in the tomb?
if (TombLocationProperty == SwordProperty.GetCurrentLocation())
  Debug.Trace("The sword is in the tomb (but not a child location)!")
endIf

Notes[edit | edit source]

  • If you want to know if the actor is in the location or any of its children, you need to use IsInLocation.
    • For example, if you want to know if the actor is in SolitudeLocation or any of the city interiors, use IsInLocation(SolitudeLocation).
  • If you want to compare two different actors' locations TO one another, you probably want to use IsSameLocation.
  • The vast majority of wilderness cells do not have a location, to which this function will return none if the Cell has no location assigned to it and print an error to the log.

See Also[edit | edit source]