Difference between revisions of "GetInCurrentLoc"

From the CreationKit Wiki
Jump to navigation Jump to search
imported>SJML Bot
(Bot creating condition functions pages.)
 
(Add my findings about the behavior of GetInCurrentLoc when filling aliases, specifically that a reference's current and persistence location are both considered.)
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
==Description==
==Description==
[[GetInCurrentLoc]] returns 1 if the reference's current location is (or has a parent location of) the supplied location.
[[GetInCurrentLoc]] returns 1 if the reference's current location is (or has a parent location of) the supplied location. If run on a location, returns 1 if the parent of the location is (or has a parent location of) the supplied location.
 
When you use <code>GetInCurrentLoc</code> to fill a [[Reference Alias]], be aware that a reference's current ''actual'' location as well as its [[Reference#Persist_Location|''persistence location'']], if it has one, will be considered.
 
For example, if an Actor is currently in Markarth but has a persistence location of <code>WhiterunLocation</code>, then <code>GetInCurrentLoc WhiterunLocation</code> will match the Actor, even though the Actor is actually in Markarth.


==Syntax==
==Syntax==

Latest revision as of 21:35, 21 November 2023

Description[edit | edit source]

GetInCurrentLoc returns 1 if the reference's current location is (or has a parent location of) the supplied location. If run on a location, returns 1 if the parent of the location is (or has a parent location of) the supplied location.

When you use GetInCurrentLoc to fill a Reference Alias, be aware that a reference's current actual location as well as its persistence location, if it has one, will be considered.

For example, if an Actor is currently in Markarth but has a persistence location of WhiterunLocation, then GetInCurrentLoc WhiterunLocation will match the Actor, even though the Actor is actually in Markarth.

Syntax[edit | edit source]

[ObjectREF].GetInCurrentLoc Location

Examples[edit | edit source]

player.GetInCurrentLoc WhiterunLocation   ;returns true if player is in WhiterunLocation or in a location that has WhiterunLocation as a parent.

See Also[edit | edit source]

Papyrus Functions[edit | edit source]