Daimonicon Posted September 25, 2021 Share Posted September 25, 2021 Hello, I have created a custom mod that provides me with some path shrines as an alternative to complete fast travel. I have 12 way shrines and would like to reliably determine if they have been discovered and are theoretically unlocked as fast travel destinations. I say theoretically because I want to disable fast travel later. In my search I came across the following possibility that I could understand even as a non-professional. Function CheckStatusDiscover() if IsLocationDiscovered(dsm473_MapMarker_Shrine01) ; Do stuff you want to do if marker is on map and can be traveled to (player has been to location or marker was enabled as being travel ready) dsm473_Shrine01_Discovered_G.SetValue(1) endif ... ... EndFunction Bool Function IsLocationDiscovered(ObjectReference akMapMarker) ; Returns true if the location's map marker is visible and ; can be fast traveled to, indicating it has been discovered. If (akMapMarker.IsMapMarkerVisible() == TRUE && akMapMarker.CanFastTravelToMarker() == TRUE) return true else return false EndIf EndFunction Already when discovering the first shrine, all are recorded as discovered. I have reduced the code to the area that should actually determine the "discovered" status. The global variable should then show or hide destinations in a menu. Link to comment Share on other sites More sharing options...
Daimonicon Posted September 26, 2021 Author Share Posted September 26, 2021 The question has been answered. I foolishly used copy and paste too often. Thus I have queried the same object reference 12 times. Link to comment Share on other sites More sharing options...
Evangela Posted September 28, 2021 Share Posted September 28, 2021 (edited) I was the one that came up with that isLocationDiscovered function. I had tested it thoroughly but I often wondered if it'd truly work for other people. I can probably fix the syntax a bit to make it even more readable by breaking it up in 2 condition statements. Bool Function isLocationDiscovered(ObjectReference akMapMarker) if akMapMarker.IsMapMarkerVisible() == True if akMapMaker.CanFastTravelToMarker() == True return true endif endif return false EndFunctionSo if any of those aren't true, it'll return that the map hasn't been discovered yet. You can't fast travel to a marker that isn't visible (on the map) and discovery is what makes it visible in the first place, but this also covers markers that ARE 'visible'(they will be darkened) but can't be fast traveled to because they haven't been discovered yet. Edited September 28, 2021 by Rasikko Link to comment Share on other sites More sharing options...
Daimonicon Posted October 15, 2021 Author Share Posted October 15, 2021 @Rasikko Hello, I had overlooked the post. The function seems to work fine so far. With the changes it is better readable I have taken over immediately - thank you Link to comment Share on other sites More sharing options...
Recommended Posts