TheBlob2 Posted March 28, 2015 Share Posted March 28, 2015 is there a way to detect how far the player is from any map marker?and by any map marker, i mean any map marker at all, vanilla and modded Link to comment Share on other sites More sharing options...
DopeChuck Posted March 28, 2015 Share Posted March 28, 2015 There is the GetDistance function. Syntax: (Distance:float) [Actor, Activator].GetDistance Target:ref Example: player.GetDistance MapMarkerREFPlease note: If the reference is null (empty), or is not in the current cell, the script will crash.Source: The GECK Bethsoft Wiki Hint: Player is 128 units tall. 7 units is about equal to 10 cm. (see here) Hope I helped! Link to comment Share on other sites More sharing options...
TheBlob2 Posted March 28, 2015 Author Share Posted March 28, 2015 ok, now all i need is a way to detect the nearest map marker to the player Link to comment Share on other sites More sharing options...
DopeChuck Posted March 28, 2015 Share Posted March 28, 2015 ok, now all i need is a way to detect the nearest map marker to the playerWell, I'm brand new to TESScript (I believe that's the name for the scripting used in GECK, as it's the same used in Oblivion and Skyrim). So I'm not sure exactly what to do for that. I know in FOSE there's the function GetFirstRef, GetNextRef. Which may or may not work in your case, as I said, I'm new to it, plus I haven't even started with scripting in FOSE (but I may need it for my mod eventually) If you want you can find the documentation for the GetFirstRef function here.Warning: If you use GetFirstRef, creating an infinite loop will result in game crashing. (Sort of like infinite loops in for statements in Python) There's also the GetRefs function in NVSE which returns an array of the refs in the cell it's ran in. See documentation here. Link to comment Share on other sites More sharing options...
Gribbleshnibit8 Posted March 29, 2015 Share Posted March 29, 2015 GetRefs is totally the way to go about doing it. Map markers are part of the Static group of objects, so you can look for type 32 GetRefs 32 3 would get all statics within a 3 cell range, which will encompass all loaded cells. The best part about this function is that you don't have to do a gamemode loop. Once the array is created you can then use the, imo, way better foreach loop to process the array, which among other things avoids the infinite loop issue as well as the logical issues of having to create your own exit conditions. This code uses the Lutana version of the function, but you can place the NVSE version in there and it works the same. Link to comment Share on other sites More sharing options...
Recommended Posts