Jump to content

[WIP] Fast Travel Enabled ONLY FOR CHOSEN MARKERS


effeob

Recommended Posts

I have been looking for a mod that does 2 things:

1) Disables fast travel

2) Enables fast travel to my own player home, High Hrothgar, Throat of the World, and allows me to select map markers either in-game or out-of-game that I want to allow fast-travel to. Out of game might be better.

 

Now,

1) There exists lots of these mods, to disable fast-travel....so no problem there.

2) None of those mods allow fast-travel AT ALL. So they dont solve my problem. (I still want to allow fast travel - but only to a few select places).

 

What I want to build is a mod where I can still fast travel to:

1) All Holds/Cities

2) Player Home Markers

3) High Hrothgar (and any other really far out of the way places that I so chose)

4) Otherwise, fast-travel is disabled.

 

I am wanting to use the "Better Fast Travel - Carriages and Boats Overhaul" mod to make it more immersive --- while also using a "fast travel disabled" mod --- BUT, I dont want to run up the "7000 steps" to high hrothgar everytime I have to go there. I also want to have fast-travel enabled to my player home (whichever one I chose to use) because otherwise its not really a "player home" now is it?

 

So....

I'm looking at papyrus scripting as it seems to be the way to solve this, and am wondering:

* How do I detect what the player clicks on when clicking a map marker on the map? I cant seem to find any "Get()" function to get what the player clicked on. Is there an EVENT trigger when the player clicks a map marker?

* How do I package a papyrus script the easiest? Make an esp?

* What about in-game customizability with MCM?

* Can I create a new global variable or function exposure in this mod which other modders can then use to enable fast-travel to their player homes and such?

 

I am totally new to Skyrim modding although did lots of Oblivion modding...

 

Any help appreciated.

Link to comment
Share on other sites

Well I've made some progress already.

 

Was able to take apart one of those "fast travel disabled" mods to check the papyrus scripts and found this:

EVENT OnTriggerEnter(objectReference triggerRef)
	if triggerRef == GetPlayer()
		Game.EnableFastTravel(false)
	endif
endEvent

EVENT OnTriggerLeave(objectReference triggerRef)
	if triggerRef == GetPlayer()
		Game.EnableFastTravel(true)
	endif
endEvent

Which I've extended to this:

Scriptname MODFastTravelSelective extends ObjectReference  
{block fast travel while the player is in this trigger}

import game

string[] EnabledAreas = new string[10]
EnabledAreas[0] = "GET ID OF WHITERUN"
EnabledAreas[1] = "GET ID OF RIFTEN"
EnabledAreas[2] = "GET ID OF MARKARTH"
EnabledAreas[3] = "GET ID OF FALKREATH"
EnabledAreas[4] = "GET ID OF SOLITUDE"
EnabledAreas[5] = "GET ID OF WINTERHOLD"
EnabledAreas[6] = "GET ID OF ....etc"
EnabledAreas[7] = "high hrothgar"
EnabledAreas[8] = "throat of the world"
EnabledAreas[9] = ""
EnabledAreas[10] = ""

EVENT OnTriggerEnter(objectReference triggerRef)
	if triggerRef == GetPlayer()
		Game.EnableFastTravel(false)
	endif
endEvent

EVENT OnTriggerLeave(objectReference triggerRef)
	if triggerRef == GetPlayer()
		Game.EnableFastTravel(true)
	endif
endEvent

Now the question is:

how to make check the parameter on OnTriggerEnter (triggerRef) to check which reference was triggered?

Or is that even the right reference?

Its matching triggerRef to "Player" so maybe its "what refID triggered this event" rather than "what refID was triggered"??

 

Which means I'll still have to find the refID or some kind of ID of whichever map marker was clicked?

Link to comment
Share on other sites

Okay, so I have two ideas. The first is to test to see if disabling and re-enabling a map marker will reset it to it's default discovery option. As in, make it so it doesn't show up on the map and then if revealing them with a script will make you able to make them known but not discovered (so you can't travel to them).

 

If so then either

  1. Make a script which searches the player's vicinity for the nearest map marker. Then, when the player is a good distance away from them, disable/enable them, and reveal them. They continue to show up on the map but can't be traveled to unless they're in a white list that you check against to allow certain ones
  2. Make a script and attach the script to every map marker that should reset itself and have it do that when the player changes cells after being near them.

The first would be better since you wouldn't have to modify the map markers themselves. But that's only if it could be efficiently done.

 

If it DOESN'T reset they're discovery state, then you might try finding a way to check if the player traveled using a cart or is at one of the allowed destinations. If not, either move them back from where they came or move them to the nearest acceptable destination immediately.

 

Finding when the player fast travels might be an issue. A couple ideas on that (although they're admittedly a bit complicated).

  1. Create two markers. Have a script in a quest. While the player is not in an interior (If !Game.GetPlayer().IsInInterior()), move the first marker to the player. Get the distance between the two. If that distance is relatively small (though large enough to allow for expansive buildings or dungeons), then move the second marker to the first marker. If it's too large, then you can assume the player fast traveled. Three problems: false exterior cells, Blackreach, and teleport spells. Some cells are interiors but are listed as exterior for certain reasons (like being able to see the sky through the huge openings in... I think Ragnvald). They'll need dealt with. Blackreach is large enough that entering one entrance and exiting another will always be seen as fast traveling and will also need dealt with. Finally, teleportation spells added by mods would register as fast traveling. (Could be done with one marker. I don't remember why I initially needed two...) If you decided to move them back from where they came, then that marker will be a handy destination.
  2. Place a trigger box around each fast travel marker that shouldn't be allowed. Make a trigger box which will move to the player when the player leaves it (it'll be like a marker that doesn't have an updating script). Put a small delay on the following trigger. When the player enters one of the fast travel triggers,check the distance between it and the trigger that follows the player. If it's too large, it'll mean fast traveling. It'll solve the Blackreach problem and any other problems caused by large interiors with multiple exits. However, teleportation spells will still register. Downside to this one is manually placing a trigger box at every map marker.

Another solution entirely would depend on whether or not you could disable fast travel while a menu is open. Basically, have a quickly updating script. Have the script check if a menu is open. If one is, check if fast travel is enabled. If it is, disable it. When the menu is no longer open, enable it if it was originally enabled. That'll make it so the player can't fast travel using the map, but the fast travel can still be reliably checked by other things (instead of simply disabling it permanently). Then, give the player a teleport spell to replace the vanilla fast traveling system which only has the options for the destinations you choose.

 

Finally, if a teleport spell will trigger it, so will travelling with a carriage. You can get around that by checking the player's sitting position. Keep track of it. If the player is sitting, then for the next 10 seconds of gameplay (not counting loading times), assume it's not fast travel. That's because the player has to sit for a carriage to activate. It might not be sitting that needs checked, but you can pull apart the carriage script to find out exactly what to check.

----------

 

In the script you're using, it would look at a trigger, and when the player enters it, fast travel is disabled. When the player leaves it, it's enabled again. The line regarding triggerRef and Game.GetPlayer() is just making sure that the NPC that entered or left the trigger was in fact the player.

 

Also, if you have the line "import Game" then when you call things that would normally have "Game." at the beginning, like "Game.GetPlayer()", you don't need "Game." at the beginning. That's what "import Game" is for.

 

I fully expect this to be followed by more questions. I don't expect it to all be understood right away. So, feel free to ask. I'll try and help the best I can.

Link to comment
Share on other sites

You guys have some great ideas, but from what I'm seeing all the mods that used to completely disable fast travel (exception is the script dragon one) no longer work in the latest Skyrim.

Link to comment
Share on other sites

I use a mod which disabled fast travel and it works fine. I have another one which I use with a different character which disables fast travel while you're on foot so you can only fast travel if you're riding a horse. They both seem to work without a problem. And besides that, most of my reply suggests ways to do it without bothering with the EnableFastTravel() function, it does it at the travel marker level, so even if Bethesda did accidentally break disabling fast travel, it would still work.

Link to comment
Share on other sites

Apparently, my game hadn't updated for some reason (or something happened which kept mine working, but only temporarily). I just loaded up the game after making sure it updated and the travel mounts mod did in fact fail. I wonder why. Either way, like I said, much of what I suggested would still work, regardless.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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