Takahanbu Posted April 27, 2019 Share Posted April 27, 2019 Is there any generalized way to find the parent location (as defined in the CK) of a given location at runtime ?For example, I'm trying to check, if 'MyCurrentLocation', or any of its parent locations have the 'LocTypeCity' keyword (= if the player is still within a city or in any of its buildings).Unfortunately, the location script has no 'parent' member or function? Sure, as long as I have a specific form list of 'city' locations, I could test for each with 'IsChild()'. But this requires a form list for each LocType (it would be easy to miss a few locations) and does not automatically work with additional locations added by other mods, even if they use the right keywords. I would much prefer a more generalized approach if possible. Am I out of luck here? Or might there be a solution I am missing? Link to comment Share on other sites More sharing options...
Evangela Posted April 27, 2019 Share Posted April 27, 2019 (edited) Attempted this in the past, though, I didn't need to care about modded locations. You'll need to check if the current location is a child of all locations in the game. LocType** is unreliable because not every location has any of those keywords. I can say that a few locations are "nested", You might have something like ThisLocation > ThatLocationsParentLocation > ThatParentLocationsParentLocation. Or.. AlvorHouseLocation > RiverwoodLocation > WhiterunHoldLocation > TamrielLocation. As you can see, this will be tough to do. You're best bet is to start with the hold locations as they are parents of a vast majority of the vanilla locations. There is also the matter of wilderness cells. Many of them do not have locations, but I made a list a while back of the ones that do. (I did not check the DLCs).https://www.creationkit.com/index.php?title=Talk:GetCurrentLocation_-_ObjectReference Edited April 27, 2019 by Rasikko Link to comment Share on other sites More sharing options...
Recommended Posts