Background for Skyrim SE
Member of the Location script
boolfunctionIsSameLocation(LocationakOtherLocation, KeywordakKeyword=NONE)

Description

Wiki Description

Returns true if the calling location is the same as the supplied location. Or, if an optional keyword is supplied it also returns true if the locations share a parent with that keyword, or one of the locations has the keyword and is a parent of the other.

Documentation String

Returns true if the calling location is the same as the supplied location - if an optional keyword is supplied, it also returns true if the locations share a parent with that keyword, or if either location is a child of the other and the other has that keyword.


Parameters

  1. LocationakOtherLocation

    CK Wiki Description

    The other location to look at.

  2. KeywordakKeyword=NONE

    CK Wiki Description

    if supplied, it uses the keyword to test if the locations share a parent with that keyword, or one of the locations has the keyword and is a parent of the other.

    • Default:None

Examples

; Is myLocationProperty the same as MarylandLocationProperty?
if (MyLocationProperty.IsSameLocation(MarylandLocationProperty))
  Debug.Trace("MyLocationProperty is MarylandLocationProperty.")
endIf
; Is myLocationProperty the same as MyOtherLocationProperty OR are both locations in the same location with the keyword "LocTypeCountry" stored in LocTypeProperty?
if (MyLocationProperty.IsSameLocation(MyOtherLocationProperty, LocTypeProperty))
  Debug.Trace("MyLocationProperty is MyOtherLocationProperty or we are in the same Country (or one us is the Country the other one is in).")
endIf
; Is the player in a location that is WhiterunLocation or a location who has WhiterunLocation as a parent
; (when WhiterunProperty points to WhiterunLocation and KeywordHoldProperty points to LocTypeHold keyword)
if Game.GetPlayer().GetCurrentLocation().IsSameLocation(WhiterunProperty, KeywordHoldProperty)
  Debug.Trace("Player is in WhiterunLocation, or a child of WhiterunLocation.")
endif
;Is the player and the CourierRef (stored in pCourier) in the same settlement, town, or city (ie the "LocTypeHabitation" keyword stored in)pLocTypeHabitation
if pCourier.getCurrentLocation().IsSameLocation(Game.GetPlayer().getCurrentLocation(), pLocTypeHabitation)
  debug.trace("WICourierScript: Courier and player are in same habitation.")
else
  debug.trace("WICourierScript: Courier and player are not in same habitation.")
endif

Auto-Generated Example

Location myLocation__akOtherLocation
Keyword myKeyword__akKeyword

bool returnedValue = myLocation__toCallFunctionOn.IsSameLocation(myLocation__akOtherLocation, myKeyword__akKeyword)

Related Pages


Additional References

View this function’s page on the Skyrim Creation Kit Wiki

Some data provided by the Skyrim Creation Kit Wiki. Licensed under the Creative Commons Attribution-ShareAlike license.