Jump to content
Sign in to follow this  
Vorians

Any way to "intercept" map marker triggering?

Recommended Posts

Just wondering whether anyone knows of a way, perhaps via OBSE to intercept and override the normal game behaviour when a player clicks on a map marker to fast travel?

 

Menu scripting is something I know very little about, can a script be set to run when a specific map marker is clicked upon?

Share this post


Link to post
Share on other sites

Keychain uses a technique to intercept keypresses, should be able to use it in the map menu as well. Basically you DisableKey, capture when it's pressed with GetKeyPress, do your processing, then use TapKey to continue as normal. And make sure to re-enable the key once they leave the map menu or save the game.

Found the code

;{{{--Click functions
begin MenuMode
	if DisabledLMB
		set DisabledLMB to 0
		EnableKey 256
	endif
	if (MenuMode 1002) ;|| (MenuMode 1008) ;Don't allow in 1008 - not sure of need for it, would require shift-click to move and code to refresh container menu
		if (GetActiveMenuSelection == P1DkeyChain) && ((IsKeyPressed3 42) == 0) && ((IsKeyPressed3 54) == 0) ;<Left-shift>, <Right-shift>
			set DisabledLMB to 1
			DisableKey 256
			if (OnKeyDown 256)	
				if Clicks
					set Clicks to 2
					set ClickTimer to -1
				else
					set Clicks to 1
					set ClickTimer to .5
				endif
			endif
		endif
		if Clicks
			if (ClickTimer > 0) && (GetActiveMenuSelection == P1DkeyChain)
				set ClickTimer to (ClickTimer - GetSecondsPassed)
			else
				if (Clicks == 1) ;Hook/unhook keys
					if P1Dkey.Hooked
						P1DkeyUnhook.Activate2 P1DkeyActRef, 1
						message "Unhooked keys from keychain"
					else
						P1DkeyHook.Activate2 P1DkeyActRef, 1
						message "Hooked keys to keychain"
					endif
				else ;if (Clicks == 2) ;Open up the options menu
					P1DkeyOptions.Activate2 P1DkeyActRef, 1
				endif
				set Clicks to 0
			endif
		endif
	elseif Clicks
		set Clicks to 0
	endif
end
begin GameMode
	if DisabledLMB
		set DisabledLMB to 0
		EnableKey 256
	endif
	if Clicks
		set Clicks to 0
	endif
end
;}}}

 

Edited by haama

Share this post


Link to post
Share on other sites

Thanks haama, this does indeed show promise! I'll take a proper look after work tomorrow.

Share this post


Link to post
Share on other sites

So I got it working, then I removed some parts I believed not needed, and it stopped working. I put those parts all back exactly as they were, and it remained not working. Puzzling.

 

I'll take a break for now and try again later!

Share this post


Link to post
Share on other sites

When you’re coding for key clicks, there are a lot of events you need to deal with. I’ve tried to pare the scripts down as well and usually find I need all the checks. You can prevent fast travel to a map marker with a setting on the map marker in the CS, so there might be a setting you can change when the game is loaded via OBSE. I’m guessing you don’t have control over the map marker itself.

Yes, I just did a search for “map” in the OBSE docs and there’s a function to set the travel option. You could put that in the game loaded and reloaded events to turn off travelling to that marker. http://obse.silverlock.org/obse_command_doc.html#GetMapMarkers Quoting from memory regarding the game loaded and reloaded as I am still kicking and punching my PC. After being ignored for over a week, it decided to actually boot again. Working on a new machine, but the CPU I want is on backorder.

Share this post


Link to post
Share on other sites

The flag on the map marker record merely prevents fast travel until you have already travelled close enough to "find" the location, at which point it can be used for fast travel.

 

I'm looking into the possibility of enabling fast travel INTO the Imperial City when not in the city, in Better Cities. With Better Cities, you can only travel to outside the gates of the city, then you must use the gates to enter, after which you can fast travel anywhere within the city (but not out of it, you have to use the gates to leave the city first).

 

As I understand the Clicks variable from the Keychain script, it is required to count whether the player has single- or double-clicked the keychain, as single click toggles the keychain off/on while double click opens an options menu. Based upon my understanding, I do not need to count key clicks, I just need to detect a click (OnKeyDown 256).

 

The problem I am currently experiencing is that "If OnKeyDown 256" seems to be... I think I know why it's not working. I think I need to count key clicks, excuse me a moment.

 

EDIT

Nope, OnKeyDown resets itself, so I don't need to count clicks to prevent it registering prematurely.

Edited by Vorians

Share this post


Link to post
Share on other sites

Okay, I believe the script does work (whether or not I actually need Clicks and ClickTimer is yet to be determined) however GetMapMenuMarkerRef is not working correctly, and that's why it messes up. It does in fact say in OBSE Command Documentation/CS Wiki that this function is slow, and better to use GetMapMenuMarkerName however GetMapMenuMarkerName  doesn't appear to do anything at all.

 

The result I get is that the left mouse button gets disabled the instant I open the menu, instead of only when hovering the mouse over the specified map marker, and then after several seconds it either triggers the next part of the script (showing the messagebox) or doesn't, and the mouse button works again. And then it continues to work (even if hovering mouse over the specified map marker) for a while, before disabling again for several seconds, and triggering the next part of the script once more.

 


CallMeBob is the EditorID I assigned to the IC Market map marker for testing. If I change GetMapMenuMarkerRef == CallMeBob to something other than CallMeBob, then everything functions as normal, the script does nothing.

Using GetMapMenuMarkerRef in the console, it returns the Map Marker > FULL - Name  (which is what I would have expected GetMapMenuMarkerName to return) plus the Form ID, for example, with the IC Market map marker, you get "Imperial City Market District (00008B6D)"

 

So I'll go heat some supper instead.

Spoiler



scn BANMapOverrideScript
long  DisabledLMB
long  Clicks
float ClickTimer
ref CallMeBob
short Choice
short Choosing

Begin MenuMode
	If DisabledLMB
		Set DisabledLMB to 0
		EnableKey 256 ; 256 = Left mouse button
	EndIf
	If (MenuMode 1023)
		If (GetMapMenuMarkerRef == CallMeBob)
			Set DisabledLMB to 1
			DisableKey 256
			If (OnKeyDown 256)
				Set Clicks to 1
				Set ClickTimer to .5
			EndIf
		EndIf
		If Clicks
			If (ClickTimer > 0) && (GetMapMenuMarkerRef == CallMeBob)
				Set ClickTimer to (ClickTimer - GetSecondsPassed)
			Else
				MessageBox "debug Travel to Imperial City Market District?" "Yes" "No"
				Set Choosing to 1
				Set DisabledLMB to 0
				EnableKey 256
				Set Clicks to 0
			EndIf
		EndIf
		If (Choosing == 1)
			Set Choice to GetButtonPressed
			If (Choice == -1)
				Return
			ElseIf (Choice == 0)
				Set Choosing to -1
				Set Choice to -1
				CloseAllMenus
				Player.PositionWorld 24705, 63425, 3270, 1.5705, ICImperialPalace
			EndIf
		EndIf
	ElseIf Clicks
		Set Clicks to 0
	EndIf
End
Begin GameMode
	If DisabledLMB
		Set DisabledLMB to 0
		EnableKey 256
	EndIf
	If Clicks
		Set Clicks to 0
	EndIf
End


 

 

Edited by Vorians

Share this post


Link to post
Share on other sites

MessageBox is a separate MenuMode, so there's going to be some odd timing issues there. You can have both a MenuMode 1023 and MenuMode block, and IIRC if you put MM 1023 before MM and return it will skip the MM block. Basically I'd suggest dropping the click timer stuff, rename click to something like ICSelected to be more honest about what it does, and only detect whether the player is hovering over that map marker in MM 1023 (and then disable the key, start the MessageBox, set some flag) and then let the general MM block handle the MessageBox stuff.

Share this post


Link to post
Share on other sites

Doesn't look like you set the variable CallMeBob there, so it's really checking null. You should remove the line var CallMeBob and just use it directly/hardcoded. (Unless Oblivion script is way more janky than I remember)

If even GetMapMarkerName is too slow, you might be able to get away with https://cs.elderscrolls.com/index.php?title=GetActiveUIComponentID

Edited by haama

Share this post


Link to post
Share on other sites

Aren’t there locations in the game that don’t allow fast travel? Is that a region setting? If it’s a region setting, perhaps you could modify the IC region? Very vague memory here. 

Share this post


Link to post
Share on other sites

@ haama: I've made some adjustments based on your feedback, thanks. I now know why GetMapMenuMarkerName appeared to do nothing - it can only be used in a Set command, which wasn't mentioned in the OBSE documentation/CS wiki, so in order to use it, I would need a ref variable "set MarkerName1 to GetMapMenuMarkerName".

@ Andalay: Interiors can be flagged to prevent fast travel, however I'm not trying to prevent fast travel, I'm trying to change the destination you travel to so that it is not the location of the map marker you "click" on. Player still needs to click on the apparent map marker on the map as if it were being used normally. If I end up with a reliable working script, I will later need to add in checks that player is in the exterior worldspace.

 

So my problem right now is GetMapMenuMarkerRef is too slow, and I don't know what GetMapMenuMarkerName is actually outputting, so I do not know what condition to check for.

As GetMapMenuMarkerName can only be used in a Set command, I have no idea how to then display in console or in Message the result. I tried using a "string_var Debug" to be displayed using "message $debug" however I cannot work out how to initialise Debug with the result of GetMapMenuMarkerName, so the message I end up with is always just "$Debug" (I have removed those lines from the script again).

 

An easier way of doing all of this would be to just let the player fast travel to the vanilla destination and place an activator to jump them to the alternate destination, however I'd rather avoid that as it would mean two load screens.

 

 

This script works (I tried adding a second MenuMode block as suggested by haama - but then found it wasn't needed). However, you have to hover the mouse over the map marker long enough for the script to detect it, otherwise clicking just triggers the marker as normal. Then you have to click and HOLD the mouse button down in order for the script to detect OnKeyDown, otherwise nothing happens. Then the message box opens, options can be clicked (might be a slight delay before clicking works normally again), message box closes and about half a second later menus close and player is transported (time passing is not taken into account, don't think I can offer that to match the game).

Spoiler



scn BANMapOverrideScript
long  DisabledLMB
long  ICSelected
short Choice
short Choosing
;ref MarkerName1
short DoOnce
;string_var ICMarket

Begin MenuMode 1023
	If DisabledLMB
		Set DisabledLMB to 0
		EnableKey 256
;		Set MarkerName1 to GetMapMenuMarkerName
	EndIf
;	If (MarkerName1 == ICMarket)
	If (GetMapMenuMarkerRef == CallMeBob)
		Set DisabledLMB to 1
		Set DoOnce to 0
		DisableKey 256
		If (OnKeyDown 256)
			Set ICSelected to 1
		EndIf
	EndIf
;	If ICSelected && (MarkerName1 == ICMarket)
	If ICSelected && (GetMapMenuMarkerRef == CallMeBob)
		Set DisabledLMB to 0
		EnableKey 256
		Set Choosing to 1
		Set ICSelected to 0
		MessageBox "debug This is a custom message." "Yes" "No"
	EndIf
	If (Choosing == 1)

		Set Choice to GetButtonPressed

		If (Choice == -1)

			Return

		ElseIf (Choice == 0)

			Set Choosing to -1

			Set Choice to -1

			CloseAllMenus

			Player.PositionWorld 24705, 63425, 3270, 1.5705, ICImperialPalace

		EndIf

	EndIf

End

Begin GameMode
	If DoOnce
		Return
	Else
		If DisabledLMB
			Set DisabledLMB to 0
			EnableKey 256
		EndIf
		If ICSelected
			Set ICSelected to 0
		EndIf
;		Set ICMarket to sv_Construct "Imperial City Market District (00008B6D)"
		Set DoOnce to 1
	EndIf
End


 


 

Edited by Vorians

Share this post


Link to post
Share on other sites

It might be possible to hack into  &MapMenu; in order to trap the single click event. An example is here, but no experience with it, sorry.

Share this post


Link to post
Share on other sites

I guess you can't use string variables with the vanilla MessageBox? I only see numeric examples on the wiki https://cs.elderscrolls.com/index.php?title=MessageBox

Oh dear lord that's right there are no string variables in vanilla Oblivion. I'm sure if we ever hear the true stories of Bethesda programmers it includes weekly riots. Okay, I'm going off what you posted and gonna' guess you switched some variables and variable types around in the heat of the moment. Try something like

string_var MarkerName
string_var ICMarkerName
...
MenuMode 1023
begin
  set ICMarkerName to sv_contruct "the actual name" ;really only has to be done once
  set MarkerName to GetMapMarkerName
  if (sv_compare(MarkerName, ICMarkerName))
  ...
  MessageBoxEx "Scare the peasants by suddenly appearing in the middle of $z?|Yes|No" MarkerName

Note that's with OBSE's https://cs.elderscrolls.com/index.php?title=MessageBoxEx

For faster key press detection, maybe try https://cs.elderscrolls.com/index.php?title=IsKeyPressed2 It's a bit more to set it up as shown in the wiki, but doesn't try to handle the status like GetButtonPressed (only returns true once per script per event) so might be faster.

Edited by haama

Share this post


Link to post
Share on other sites

I forgot to say that the commented out lines in my previous script post were part of the attempt to use GetMapMenuMarkerName, and as that didn't work, I commented but didn't remove them yet. Thus they were not a part of the "working" script.

 

@ Schteam: Thanks, I didn't really understand the info you linked to, however I believe it relies on the menu object being registered as clicked, which I'm attempting to block and override. I may have misunderstood even the bits which I think I understood though!

@ haama: So I tried using the following (because apparently only a result of 0 equals a match):

		set ICMarkerName to sv_Construct "Imperial City Market District" ; in a DoOnce block

		Set MarkerName to GetMapMenuMarkerName
		If (sv_compare MarkerName ICMarkerName) == 0
			MessageBoxEx "debug %z" MarkerName
		Else
			MessageBox "debug Nope"
		EndIf

The result was Nope every time. If however I removed == 0 then the result was Imperial City Market District every time, which means " the string variable occurs alphabetically before the formatted string" (I don't understand what that means).

 

In terms of responsiveness/speed, I'll take a look at IsKeyPressed2 tomorrow, thanks for that idea.

Share this post


Link to post
Share on other sites

That function will compare letter by letter, case insensitive, so it means the first argument, MarkerName, probably has some spaces as the first few letters, I guess for formatting. I wanted to do a Map Marker mod for FO4, so I might fire up your script and try a few things. Crossing my fingers that DebugPrint will make things a bit clearer

Share this post


Link to post
Share on other sites

Oh yeah there it is. I remember Oblivion being aggravating beyond other worldly comprehension, but now the details are starting to come back. Okay, so this will pick up selection changes as the player moves the mouse.

scn aaaTestMapMenuQS

string_var tempName
string_var MarkerName
float fQuestDelayTime

begin MenuMode 1023
	if (fQuestDelayTime == 0)
		set MarkerName to sv_Construct " "
		set fQuestDelayTime to 0.001
	endif
	set tempName to GetMapMenuMarkerName
	if (sv_compare "%z" tempName MarkerName != 0)
		PrintC "Selection changed from %z to %z" MarkerName tempName
		set MarkerName to sv_Construct "%z" tempName
	endif
end

Note this runs on a quest, which by default runs every 5 seconds, so that needed to change. I'm assuming you're doing the same Vorians and that's why you're seeing the delays.

Also note the formatted string as the first argument of sv_compare. Very flexible, but so unexpected.

Edited by haama

Share this post


Link to post
Share on other sites

Oh wow, I am so forgetful! Of course I needed fQuestDelayTime, I totally forgot about it.

 

Thanks haama, I appear to have a script working exactly as desired now using GetMapMenuMarkerRef and Bob, so I can add the location checks to prevent working in an interior, and then expand it to cover the other map markers.

 

Andalay, did your PC stop working again? I didn't know about shadeMe's debugger, I've always just done it manually. ShadeMe states in the comments that it doesn't support string variables however, so in this particular case it would not have been able to help. Fortunately it appears I no longer need to debug!

 

EDIT

Oh hey, you were right about worldspaces also having a flag for no fast travel Andalay, just noticed it while checking which worldspaces the script should work in.

Edited by Vorians

Share this post


Link to post
Share on other sites

Yep, working. Thanks all for your help. Here's the script in case any part is of any use to others.

 

Spoiler

scn BANMapOverrideScript
float fQuestDelayTime
long DisabledLMB
long ICSelected
short Choice
short Choosing
short DoOnce

Begin MenuMode 1023
	If (fQuestDelayTime == 0)
		Set fQuestDelayTime to 0.001
	EndIf
	If DisabledLMB
		Set DisabledLMB to 0
		EnableKey 256
	EndIf
	If (Choice == 1)
		Set Choice to -1
	EndIf

	If (Choosing == 1)
		Set Choice to GetButtonPressed
		If (Choice == -1)
			Return
		ElseIf (Choice == 0)
			Set Choosing to -1
			Set Choice to -1
			CloseAllMenus
			Player.PositionWorld 33597, 72011, 3337, 3.682, ICMarketDistrict
		EndIf
		Return
	EndIf
	If (Choosing == 2)
		Set Choice to GetButtonPressed
		If (Choice == -1)
			Return
		ElseIf (Choice == 0)
			Set Choosing to -1
			Set Choice to -1
			CloseAllMenus
			Player.PositionWorld 34360, 63448, 3619, 1.5705, ICArenaDistrict
		EndIf
		Return
	EndIf
	If (Choosing == 3)
		Set Choice to GetButtonPressed
		If (Choice == -1)
			Return
		ElseIf (Choice == 0)
			Set Choosing to -1
			Set Choice to -1
			CloseAllMenus
			Player.PositionWorld 33647, 54770, 3584, 5.7585, ICArboretumDistrict
		EndIf
		Return
	EndIf
	If (Choosing == 4)
		Set Choice to GetButtonPressed
		If (Choice == -1)
			Return
		ElseIf (Choice == 0)
			Set Choosing to -1
			Set Choice to -1
			CloseAllMenus
			Player.PositionWorld 23710, 54773, 3546, 0.5235, ICTempleDistrict
		EndIf
		Return
	EndIf
	If (Choosing == 5)
		Set Choice to GetButtonPressed
		If (Choice == -1)
			Return
		ElseIf (Choice == 0)
			Set Choosing to -1
			Set Choice to -1
			CloseAllMenus
			Player.PositionWorld 18677, 63428, 3333, 1.5705, ICTalosPlazaDistrict
		EndIf
		Return
	EndIf
	If (Choosing == 6)
		Set Choice to GetButtonPressed
		If (Choice == -1)
			Return
		ElseIf (Choice == 0)
			Set Choosing to -1
			Set Choice to -1
			CloseAllMenus
			Player.PositionWorld 23936, 71615, 3334, 2.6175, ICElvenGardensDistrict
		EndIf
		Return
	EndIf
	If (Choosing == 7)
		Set Choice to GetButtonPressed
		If (Choice == -1)
			Return
		ElseIf (Choice == 0)
			Set Choosing to -1
			Set Choice to -1
			CloseAllMenus
			Player.PositionWorld 24706, 63425, 3270, 1.5705, ICImperialPalace
		EndIf
		Return
	EndIf
	If (Choosing == 8)
		Set Choice to GetButtonPressed
		If (Choice == -1)
			Return
		ElseIf (Choice == 0)
			Set Choosing to -1
			Set Choice to -1
			CloseAllMenus
			Player.PositionWorld 36501, 76983, 3104, 0.5235, ICImperialPrisonDistrict
		EndIf
		Return
	EndIf
	If (Choosing == 9)
		Set Choice to GetButtonPressed
		If (Choice == -1)
			Return
		ElseIf (Choice == 0)
			Set Choosing to -1
			Set Choice to -1
			CloseAllMenus
			Player.PositionWorld 36444, 49887, 3172, 2.6175, ICTheArcaneUniversity
		EndIf
		Return
	EndIf
	If (Choosing == 10)
		Set Choice to GetButtonPressed
		If (Choice == -1)
			Return
		ElseIf (Choice == 0)
			Set Choosing to -1
			Set Choice to -1
			CloseAllMenus
			Player.PositionWorld 20924, 76646, 2719, 5.7585, ICAristocraticDistrict
		EndIf
		Return
	EndIf

	If (Player.GetInWorldspace Tamriel) || (Player.GetInWorldspace AnvilCastleCourtyardWorld) || (Player.GetInWorldspace AnvilWorld) || (Player.GetInWorldspace BravilWorld) || (Player.GetInWorldspace BrumaWorld) ||(Player.GetInWorldspace ChorrolWorld) || (Player.GetInWorldspace KvatchEast) || (Player.GetInWorldspace KvatchEntrance) || (Player.GetInWorldspace KvatchPlaza) || (Player.GetInWorldspace LeyawiinWorld) || (Player.GetInWorldspace SkingradWorld) || (Player.GetInWorldspace TGTempleOfTheEmperorZero)
		If (GetMapMenuMarkerRef == BANICMMarker) || (GetMapMenuMarkerRef == BANICAreMarker) || (GetMapMenuMarkerRef == BANICArbMarker) || (GetMapMenuMarkerRef == BANICTemMarker) || (GetMapMenuMarkerRef == BANICTalMarker) || (GetMapMenuMarkerRef == BANICElvMarker) || (GetMapMenuMarkerRef == BANICPalMarker) || (GetMapMenuMarkerRef == BANICPriMarker) || (GetMapMenuMarkerRef == BANICAUMarker) || (GetMapMenuMarkerRef == BANICAriMarker)  
			Set DisabledLMB to 1
			Set DoOnce to 0
			DisableKey 256
			If (OnKeyDown 256)
				Set ICSelected to 1
			EndIf
		EndIf
		If ICSelected
			Set DisabledLMB to 0
			EnableKey 256
			If (GetMapMenuMarkerRef == BANICMMarker)
				Set Choosing to 1
				Set ICSelected to 0
				MessageBox "Travel to Imperial City Market District?" "Yes" "No"
				Return
			EndIf
			If (GetMapMenuMarkerRef == BANICAreMarker)
				Set Choosing to 2
				Set ICSelected to 0
				MessageBox "Travel to Imperial City Arena District?" "Yes" "No"
				Return
			EndIf
			If (GetMapMenuMarkerRef == BANICArbMarker)
				Set Choosing to 3
				Set ICSelected to 0
				MessageBox "Travel to Imperial City Arboretum District?" "Yes" "No"
				Return
			EndIf
			If (GetMapMenuMarkerRef == BANICTemMarker)
				Set Choosing to 4
				Set ICSelected to 0
				MessageBox "Travel to Imperial City Temple District?" "Yes" "No"
				Return
			EndIf
			If (GetMapMenuMarkerRef == BANICTalMarker)
				Set Choosing to 5
				Set ICSelected to 0
				MessageBox "Travel to Imperial City Talos Plaza District?" "Yes" "No"
				Return
			EndIf
			If (GetMapMenuMarkerRef == BANICElvMarker)
				Set Choosing to 6
				Set ICSelected to 0
				MessageBox "Travel to Imperial City Elven Gardens District?" "Yes" "No"
				Return
			EndIf
			If (GetMapMenuMarkerRef == BANICPalMarker)
				Set Choosing to 7
				Set ICSelected to 0
				MessageBox "Travel to Imperial City Palace District?" "Yes" "No"
				Return
			EndIf
			If (GetMapMenuMarkerRef == BANICPriMarker)
				Set Choosing to 8
				Set ICSelected to 0
				MessageBox "Travel to Imperial City Prison District?" "Yes" "No"
				Return
			EndIf
			If (GetMapMenuMarkerRef == BANICAUMarker)
				Set Choosing to 9
				Set ICSelected to 0
				MessageBox "Travel to Imperial City, The Arcane University?" "Yes" "No"
				Return
			EndIf
			If (GetMapMenuMarkerRef == BANICAriMarker)
				Set Choosing to 10
				Set ICSelected to 0
				MessageBox "Travel to Imperial City Aristocratic District?" "Yes" "No"
				Return
			EndIf
		EndIf
	EndIf
End

Begin GameMode
	If (fQuestDelayTime)
		Set fQuestDelayTime to 0
	EndIf
	If DoOnce
		Return
	Else
		If DisabledLMB
			Set DisabledLMB to 0
			EnableKey 256
		EndIf
		Set ICSelected to 0
		Set Choosing to -1
		Set Choice to -1
		Set DoOnce to 1
	EndIf
End

 

 

Share this post


Link to post
Share on other sites

My PC is kinda sorta working. :P I posted the latest update in the TAL Shutting Down - Sort Of thread in the News forum.

Yeah I was pretty sure worldspaces had the flag because you can’t fast travel from Oblivion planes or What its Paradise.

Share this post


Link to post
Share on other sites

Following on from the initial query, now that the script exists and works. Is there a (sensible) way to calculate how much time should have passed based upon the player's position when triggering my script, and where they end up afterwards? So that my script can also advance time to at least roughly match vanilla Fast Travel?

Share this post


Link to post
Share on other sites

Thanks, but no that sets the flag on map marker records controlling whether it can be used or not.

 

I believe the game calculates the distance as the crow flies (not considering the terrain) from where you are to where you're travelling to, and then does some internal look up to calculate how much time should pass for that distance.

 

So in theory, a script could do a player.getpos X and player.getpos Y as they click on the map marker icon which triggers my override, then compare them to the XY coordinates of the destination and calculate a time based upon the difference?

Share this post


Link to post
Share on other sites

Missed this response - as long as getPos works on the map marker as well, should work. To be safe, use https://cs.elderscrolls.com/index.php?title=GetInWorldspace to check not only if the map marker (and player) are in the same worldspace, but also if they're in an exterior cell.

I'm wondering a bit out of familiar territory at this point, relying on general scripting know-how.

Edited by haama

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×