Jump to content

[LE] [Creation Kit] Is there a condition function for having discovered a location?


Recommended Posts

I'm looking for a condition function for having discovered a location.

I've tried using "GetMapMarkerVisible" and then linking the reference to the Map Marker of the location in question. However, this doesn't seem to work for some reason. It only checks if the Map Marker has the "visible" tag checked, regardless of showing up on the map.

My goal is to make certain dialogue from the carriage drivers hidden until the player has discovered all main cities. Is there another way to do this, without using scripts.

 

Thanks in advance

 

Kind regards

 

Andre

 

Link to comment
Share on other sites

use CanFastTravelToMarker() == True

 

http://www.creationkit.com/CanFastTravelToMarker_-_ObjectReference

 

I can't see any way to do it through dialog conditions, there are no references to map marker states in them that I noticed. You would have to set up a script that would check for the above condition and then if all of them are true, set a global variable and then use that global as the condition for the dialog

Link to comment
Share on other sites

What you could probably do is set up your quest which handles the dialog to run a RegisterForSingleUpdateGameTime(1) in it's startup stage and in the quest script add the code:

 

 

ObjectReference Property City1 Auto
ObjectReference Property City2 Auto
ObjectReference Property City3 Auto
GlobalVariable Property CarriageGlobal Auto
 
Event OnUpdateGameTime()
      if City1.CanFastTravelToMarker() == True && City2.CanFastTravelToMarker() == True && City3.CanFastTravelToMarker() == True
          CarriageGlobal.SetValue(1)
      Else
          RegisterForSingleUpdateGameTime(1)
      Endif
EndEvent
 

 

of course you need to extend the if check to include each of the major cities and add properties for each like the ones above, but it should work. The quest will basically check every hour in game time to see if the cities can all be traveled to, and if it passes, the global is set and it stops checking. Or if it doesn't see them all able to be traveled to, it will re-register for the update and try again.

Link to comment
Share on other sites

Thanks for the reply.

 

I was thinking about using an xmarker as an enable parent for the carriages (setting the carriages + drivers as initially disabled).

 

Then bind the script to the xmarker.

 

Would this work:

ObjectReference Property City1 Auto
ObjectReference Property City2 Auto
ObjectReference Property City3 Auto
GlobalVariable Property CarriageGlobal Auto ; I'm not sure what I should like this property to.
 
Event OnUpdateGameTime()
If City1.CanFastTravelToMarker() == True && City2.CanFastTravelToMarker() == True && City3.CanFastTravelToMarker() == True
GetLinkedRef.Enable() ; I don't know whether this will work, though.
CarriageGlobal.SetValue(1) 
Else
RegisterForSingleUpdateGameTime(1)
Endif
 
EndEvent
Edited by AndrealphusVIII
Link to comment
Share on other sites

what are you trying to accomplish by making the carriages and drivers disabled? Do you mean that the dialog option you want hidden is the default travel options? like you can only travel to cities if you have been there before?

 

if so, I would really consider doing it a different way. When you start altering vanilla resources, you can cause a lot of conflicts with other mods. It's always best to add rather than change and if you are gonna change something it's better to change the carriage dialog option conditions rather than just making them not exist until some condition is met.

 

So are you thinking that when the travel markers are travelable you will enable the Xmarker and all the carriages will enable with it? if so, here's what you need code wise:

 

 

ObjectReference Property City1 Auto
ObjectReference Property City2 Auto
ObjectReference Property City3 Auto
 
Event OnInit()
     RegisterForSingleUPdateGameTime(1)
EndEvent
 
Event OnUpdateGameTime()
If City1.CanFastTravelToMarker() == True && City2.CanFastTravelToMarker() == True && City3.CanFastTravelToMarker() == True
GetLinkedRef.Enable() ; I don't know whether this will work, though.
Enable()
Else
RegisterForSingleUpdateGameTime(1)
Endif
 
EndEvent
 

 

then you enable parent each of the carriages and rider to the Xmaker which has the code on it and set the xmarker as disabled. Just keep in mind that any mod which adds options to the carriages will be greatly hindered by what you are doing here. I think that the messenger mod or black courier mod may add options.

Link to comment
Share on other sites

what are you trying to accomplish by making the carriages and drivers disabled? Do you mean that the dialog option you want hidden is the default travel options? like you can only travel to cities if you have been there before?

 

if so, I would really consider doing it a different way. When you start altering vanilla resources, you can cause a lot of conflicts with other mods. It's always best to add rather than change and if you are gonna change something it's better to change the carriage dialog option conditions rather than just making them not exist until some condition is met.

 

So are you thinking that when the travel markers are travelable you will enable the Xmarker and all the carriages will enable with it? if so, here's what you need code wise:

ObjectReference Property City1 Auto
ObjectReference Property City2 Auto
ObjectReference Property City3 Auto
 
Event OnInit()
     RegisterForSingleUPdateGameTime(1)
EndEvent
 
Event OnUpdateGameTime()
If City1.CanFastTravelToMarker() == True && City2.CanFastTravelToMarker() == True && City3.CanFastTravelToMarker() == True
GetLinkedRef.Enable() ; I don't know whether this will work, though.
Enable()
Else
RegisterForSingleUpdateGameTime(1)
Endif
 
EndEvent
 

then you enable parent each of the carriages and rider to the Xmaker which has the code on it and set the xmarker as disabled. Just keep in mind that any mod which adds options to the carriages will be greatly hindered by what you are doing here. I think that the messenger mod or black courier mod may add options.

 

I'm trying to make ALL carriages unusable until the player has discovered ALL major cities.

 

First, I thought to approach this by adding a condition to the dialogue of the carriage drivers, but that didn't seem to work.

 

Then, I decided to initially disable the carriages until the player has discovered all major cities.

 

I'm willing to make a compatibility patch for other mods, however, I'm thinking of just using it as personal mod.

 

You mentioned another way to do what I'm trying to accomplish. Could you tell me what you meant?

 

Kind regards

 

Andre

Link to comment
Share on other sites

  • 1 year later...
  • Recently Browsing   0 members

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