Jump to content

[LE] Distance Between Locations


Kapteyn

Recommended Posts

If somebody has any ideas for getting the distance between two locations, I'd be much obliged. Now when I say locations, I mean exactly that... so I'm not talking about using object references, I'm looking at the actual distance between two places (for example, the distance between the map markers for Falkreath and the bastion on the cliff, that being the spots where one would fast-travel to).

Edited by Kapteyn
Link to comment
Share on other sites

Yeah, I thought they were. The problem is this (I actually written this, but edited it because I've kinda fixed it but still want to know if I can use locations alone)...

 

I'm scanning for markers to spawn stuff at, the actual spawns will be based on my current location type (which I define). If the location is a barrow, Draugr may spawn. The problem here is that if, for example, I'm walking into Falkreath past the bastion on the cliff, should I venture slightly off the path I might cross the border from either the general wilderness or Falkreath and into the barrow zone. So if a spawn is successful, the scanned object at which the spawn occurs could be in Falkreath because the village is within scanning range of the barrow. This is obviously a serious problem, we simply don't want Draugr appearing all day long killing everybody.

 

I've fixed it by checking if the scanned object is in the same location as myself, at least with respect to barrows. I've also stopped the scan from even selecting markers in settlements altogether so it's fine now. In any case, I am still interested to know if there is any way to determine distances without using object references.

Edited by Kapteyn
Link to comment
Share on other sites

It's fine, I've got it working flawlessly now. I'm just intrigued with my general question about locations rather than objects. Anyway...

 

Firstly I have OnLocationChange() running via an alias, but this does very few initial checks. What's actually doing the work is the main script attached to the quest which has a recurring single update with a minimum timer of one minute. So every minute it scans for markers from a form list, markers which appear by the thousands across the game world. Actually, I have two form lists - one for interiors, the other for exteriors. I'm running a series of checks to ensure things only spawn where they should, so not in villages for example or any interior which cannot be cleared (so not homes or shops). I'd post the script, but it's yuge.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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