F4llfield Posted July 24, 2023 Share Posted July 24, 2023 Hi, I would like to detect when the player is fast traveling in my script. Is there a way to do this without the locationchange ? Link to comment Share on other sites More sharing options...
DieFeM Posted July 24, 2023 Share Posted July 24, 2023 OnPlayerTeleport_-_ScriptObject Link to comment Share on other sites More sharing options...
F4llfield Posted July 24, 2023 Author Share Posted July 24, 2023 OnPlayerTeleport_-_ScriptObject Thanks DieFem, it wasn't working but I was doing the registration wrong. I was doing: RegisterForRemoteEvent(PlayerRef, "OnPlayerTeleport") instead of the correct: RegisterForPlayerTeleport() it's working now. Thanks! endEvent Link to comment Share on other sites More sharing options...
SKKmods Posted July 24, 2023 Share Posted July 24, 2023 Be careful as OnPlayerTeleport triggers on normal load doors. As will the Institute teleporter and subsequent travel to/from InstituteConcourseLocation Link to comment Share on other sites More sharing options...
LarannKiar Posted July 24, 2023 Share Posted July 24, 2023 Hi, I would like to detect when the player is fast traveling in my script. Is there a way to do this without the locationchange ? If you'd like to make a script that detects fast traveling only (i.e., to exclude load doors), you can either - Start a very short timer (StartTimer()) or wait (Utility.Wait()) after the Pip-Boy close animation finishes: when the timer expires, check if OnPlayerTeleport is received or the FaderMenu (miscellaneous menu during fading out/in) has been opened, - Edit the Pip-Boy menu interface by setting up an AS3 to Papyrus event (requires F4SE). Link to comment Share on other sites More sharing options...
F4llfield Posted July 25, 2023 Author Share Posted July 25, 2023 Thanks for your replies SKK50 and LaranKlar! I Link to comment Share on other sites More sharing options...
SKKmods Posted July 26, 2023 Share Posted July 26, 2023 Just had a dig around and my "charge caps for fast travel like in Fallout 76" function does it like this: Bool bFastTravelMenu = false ... Self.RegisterForPlayerTeleport() Self.RegisterForMenuOpenCloseEvent("PipboyMenu") ... Event OnPlayerTeleport() If (bFastTravelMenu == TRUE) && (pPlayerREF.GetCurrentLocation() != pInstituteConcourseLocation) ; PUNISH THEM EndIf bFastTravelMenu = FALSE EndEvent Event OnMenuOpenCloseEvent(string asMenuName, bool abOpening) If (asMenuName == "PipboyMenu") If (abOpening == True) bFastTravelMenu = True Else Utility.Wait(1.0) ;for events to happen bFastTravelMenu = False EndIf EndIf EndEvent Since it contains a blocking Wait, for elegance it wants to be in a standlone async script (not part of a larger event driven script). The only gotcha is if a player open/close pipboy within 1 second of using a load door that is detected as fast travel. Link to comment Share on other sites More sharing options...
Recommended Posts