Jump to content

[LE] Script: if a place has been visited ...


Recommended Posts

Hi

I would like to create a script linked to certain places which, if already visited by the player, may or may not activate certain options.
I don't want to add Map Markers in any way to do that, but I'd like to use the ones that already exist.
I'll give an example (it's just an example):
if the player has already visited Riften, spawn a statue of Mara in the garden of the player's house. . .
How can this be done with a script?
Is there a script control on the status of places, visited or not?

Thanks to who will answer!

Link to comment
Share on other sites

You could start with this implementation:

https://www.creationkit.com/index.php?title=Detect_Player_Cell_Change_(Without_Polling)

 

And in the script when the cell is changed, just filter for your desired locations, store that they have already been visited, and run what code you need.

 

 

PS: If you know that you will only need CK Locations, and will never need to distinguish between cells in a location, you can just use OnLocationChange:

https://www.creationkit.com/index.php?title=OnLocationChange_-_Actor

Then it's the same, filter for the Locations you need in the event, store that the player visited them, etc.

Link to comment
Share on other sites

You can use IsMapMarkerVisible https://www.creationkit.com/index.php?title=IsMapMarkerVisible_-_ObjectReference

 

And there they provide a function:

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

I don't think you need to use polling. Just use a triggerbox with onTriggerEnter that's near the entrance to your home, or a script on the door leading to the player home with OnActivate and use the above function to check if certain map markers are discovered.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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