Jump to content

[LE] Find out if a MapMarker has been detected ?


Daimonicon

Recommended Posts

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

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
EndFunction

So 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 by Rasikko
Link to comment
Share on other sites

  • 3 weeks later...
  • Recently Browsing   0 members

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