Jump to content

[LE] Best way to determine the current location of an NPC in a script


Recommended Posts

Hello,

 

What would be the best way to determine the current location of an NPC? By location here I mean a large area, larger than a CK Location. As in "this NPC is definitely somewhere in Whiterun". Or "definitely somewhere in Solitude + docks".

 

For example, I want to know if an NPC is in any segment of Whiterun.

I could check for their Worldpsace to be the Whiterun worldspace, that covers most of the town. But how do I handle interior cells? Interior cells are their own Worldspace, and most of them (like Jorrvaskr, Ysolda's home) are their own location too. Unfortunately these Location's don't really have Whiterun-related Keywords on them either (which could have been something to check on). I'd like to avoid the bloat of having to list a lot of conditions, manually comparing the parent location of the NPC to every Location that's known inside the city.

Is there a shortcut around this?

 

Thanks

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...