LarannKiar Posted January 15, 2024 Share Posted January 15, 2024 XMarker is editor-set persistent and as far as I remember when I tested SetEditorPersistent(akTargetRef, False) on a few markers I saw the "fade out, stand still, fade back" issue when called "14.MoveTo akTargetRef" (in the console). Unsetting persistence doesn't call HandleOnUnload or anything like that internally so the reference remains in the memory to keep the game stable. But given by MoveTo didn't work afterward (though MoveTo testing wasn't extensive) the game either frees the memory at some point when it detects there's a non-persistent reference in the memory or it's just due to the implementation of MoveTo (latter one sounds more appropriate for Fallout 4). You can call GetParentCell(), GetWorldSpace() and GetPos() functions on the marker to verify that the reference's coord data is intact. If the returned values are fine then it's probably Cell data that got untied from the ref somehow.. the only way I can think of how that could happen is that you called MoveTo on the marker beforehand (which was in another Cell) and while it should be okay they're still [EP] references and I've heard some "rumors" that the game doesn't always like it.. Link to comment Share on other sites More sharing options...
SKKmods Posted January 15, 2024 Share Posted January 15, 2024 Pull what you can from this (Starfield script, contains no frustration): InputEnableLayer SKK_TestInputLayer = InputEnableLayer.Create() SKK_TestInputLayer.DisablePlayerControls(abMovement=True, abFighting=True, abCamSwitch=True, abLooking=True, abSneaking=True, abMenu=True, abActivate=True, abJournalTabs=True, abVATS=True, abFavorites=True, abRunning=True) If(travelMarker.IsInInterior() == true) Game.FastTravel(travelMarker) ;fast travel ticks time/distance, MoveTo does not. ;PlayerRef.MoveTo(akTarget = travelMarker, afXoffset = 0.0, afYoffset = 0.0, afZoffset = 0.0, abMatchRotation = true, abRotateOffset = false) travelMarker.WaitFor3dLoad() PlayerRef.WaitFor3dLoad() Else travelMarker.PreloadExteriorCell() ;this actually does nothing to help, but looks pro. While(PlayerRef.GetPositionZ() as Int) != (travelMarker.GetPositionZ() as Int) ;danger if they just HAPPEN to be exactly the same. Game.FastTravel(travelMarker) ;fast travel ticks time/distance, MoveTo does not. ;PlayerRef.MoveTo(akTarget = travelMarker, afXoffset = 0.0, afYoffset = 0.0, afZoffset = 0.0, abMatchRotation = true, abRotateOffset = false) travelMarker.WaitFor3dLoad() ;this does f*#@ all, as does Is3dLoaded() when rendering problems happen. PlayerRef.WaitFor3dLoad() ;this does f*#@ all, as does Is3dLoaded() when rendering problems happen. Utility.Wait(1.0) ;for any falling to happen. Debug.Trace("SKK_Test.WorldspaceLoading markerZ " + travelMarker.GetPositionZ() + " playerZ " + PlayerRef.GetPositionZ(), aiSeverity=0) If(PlayerRef.GetPositionZ() as Int) != (travelMarker.GetPositionZ() as Int) Debug.Notification("FALLING") EndIf EndWhile ;no need for a bailout counter as the game is f*#@ed anyway. EndIf SKK_TestInputLayer.Reset() SKK_TestInputLayer.Delete() Link to comment Share on other sites More sharing options...
LarannKiar Posted January 15, 2024 Share Posted January 15, 2024 1 hour ago, PJMail said: I understood that - I wanted the player not to fall to far at the end (as I was transporting them into the air so they didn't appear in terrain) so some way of freezing them would be useful... Maybe this trick would work? ObjectReference targetRef = {Some reference somewhere near to the player's current location} Float Speed = {Some very slow speed to simulate staying in one place} PlayerRef.TranslateToRef(targetRef, Speed) TranslateToRef doesn't work well with player controls as far as I know so you may want to disable those. Link to comment Share on other sites More sharing options...
PJMail Posted January 15, 2024 Author Share Posted January 15, 2024 1 hour ago, LarannKiar said: XMarker is editor-set persistent and as far as I remember when I tested SetEditorPersistent(akTargetRef, False) on a few markers I saw the "fade out, stand still, fade back" issue when called "14.MoveTo akTargetRef" (in the console). Unsetting persistence doesn't call HandleOnUnload or anything like that internally so the reference remains in the memory to keep the game stable. But given by MoveTo didn't work afterward (though MoveTo testing wasn't extensive) the game either frees the memory at some point when it detects there's a non-persistent reference in the memory or it's just due to the implementation of MoveTo (latter one sounds more appropriate for Fallout 4). You can call GetParentCell(), GetWorldSpace() and GetPos() functions on the marker to verify that the reference's coord data is intact. If the returned values are fine then it's probably Cell data that got untied from the ref somehow.. the only way I can think of how that could happen is that you called MoveTo on the marker beforehand (which was in another Cell) and while it should be okay they're still [EP] references and I've heard some "rumors" that the game doesn't always like it.. I do call "Moveto" on my destination xMarker as I am placing it 'near' my destination point "DestinationMarker.MoveTo(rJumpPoint,fXOffset,fYOffset,fHeightOffset)"... Are you suggesting I should instead create the xMarker where I want it (with an "DestinationMarker = rJumpPoint.PlaceAtMe(xMarker,1,true,false,true)")? I still need to move it to the right spot though... Link to comment Share on other sites More sharing options...
PJMail Posted January 15, 2024 Author Share Posted January 15, 2024 22 minutes ago, LarannKiar said: Maybe this trick would work? ObjectReference targetRef = {Some reference somewhere near to the player's current location} Float Speed = {Some very slow speed to simulate staying in one place} PlayerRef.TranslateToRef(targetRef, Speed) TranslateToRef doesn't work well with player controls as far as I know so you may want to disable those. Interesting idea - though I think by the time it executes the player will have fallen sme distance. Link to comment Share on other sites More sharing options...
PJMail Posted January 15, 2024 Author Share Posted January 15, 2024 1 hour ago, SKK50 said: Pull what you can from this (Starfield script, contains no frustration): InputEnableLayer SKK_TestInputLayer = InputEnableLayer.Create() SKK_TestInputLayer.DisablePlayerControls(abMovement=True, abFighting=True, abCamSwitch=True, abLooking=True, abSneaking=True, abMenu=True, abActivate=True, abJournalTabs=True, abVATS=True, abFavorites=True, abRunning=True) If(travelMarker.IsInInterior() == true) Game.FastTravel(travelMarker) ;fast travel ticks time/distance, MoveTo does not. ;PlayerRef.MoveTo(akTarget = travelMarker, afXoffset = 0.0, afYoffset = 0.0, afZoffset = 0.0, abMatchRotation = true, abRotateOffset = false) travelMarker.WaitFor3dLoad() PlayerRef.WaitFor3dLoad() Else travelMarker.PreloadExteriorCell() ;this actually does nothing to help, but looks pro. While(PlayerRef.GetPositionZ() as Int) != (travelMarker.GetPositionZ() as Int) ;danger if they just HAPPEN to be exactly the same. Game.FastTravel(travelMarker) ;fast travel ticks time/distance, MoveTo does not. ;PlayerRef.MoveTo(akTarget = travelMarker, afXoffset = 0.0, afYoffset = 0.0, afZoffset = 0.0, abMatchRotation = true, abRotateOffset = false) travelMarker.WaitFor3dLoad() ;this does f*#@ all, as does Is3dLoaded() when rendering problems happen. PlayerRef.WaitFor3dLoad() ;this does f*#@ all, as does Is3dLoaded() when rendering problems happen. Utility.Wait(1.0) ;for any falling to happen. Debug.Trace("SKK_Test.WorldspaceLoading markerZ " + travelMarker.GetPositionZ() + " playerZ " + PlayerRef.GetPositionZ(), aiSeverity=0) If(PlayerRef.GetPositionZ() as Int) != (travelMarker.GetPositionZ() as Int) Debug.Notification("FALLING") EndIf EndWhile ;no need for a bailout counter as the game is f*#@ed anyway. EndIf SKK_TestInputLayer.Reset() SKK_TestInputLayer.Delete() I have been hesitant to use a position check due to the 'falling' issue (as I teleport the player into the air anyway) - so there will always likely be a Z diff by the time the loop runs. This was why Cell/Worldspace check would be better - but that seems broken if the Player fails the teleport... Link to comment Share on other sites More sharing options...
LarannKiar Posted January 15, 2024 Share Posted January 15, 2024 7 hours ago, PJMail said: I do call "Moveto" on my destination xMarker as I am placing it 'near' my destination point "DestinationMarker.MoveTo(rJumpPoint,fXOffset,fYOffset,fHeightOffset)"... Are you suggesting I should instead create the xMarker where I want it (with an "DestinationMarker = rJumpPoint.PlaceAtMe(xMarker,1,true,false,true)")? I still need to move it to the right spot though... Something like that yes. It's just a guess though so I'm not sure if it would help. Link to comment Share on other sites More sharing options...
Recommended Posts