4
Fork 0

Moved SafeMove functions to a dedicated script

Eddoursul 3 months ago
parent 99cd517996
commit d92df9d75d
  1. BIN
      scripts/_00e_func_safemove.pex
  2. BIN
      scripts/_00e_gypsyminstrelscontrolscript.pex
  3. BIN
      scripts/_00e_mq06_functions.pex
  4. BIN
      scripts/_00e_mq12b_functions.pex
  5. BIN
      scripts/_00e_nq10_functions.pex
  6. BIN
      scripts/_00e_questfunctions.pex
  7. 41
      source/scripts/_00e_func_safemove.psc
  8. 6
      source/scripts/_00e_gypsyminstrelscontrolscript.psc
  9. 16
      source/scripts/_00e_mq06_functions.psc
  10. 2
      source/scripts/_00e_mq12b_functions.psc
  11. 2
      source/scripts/_00e_nq10_functions.psc
  12. 40
      source/scripts/_00e_questfunctions.psc

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

@ -0,0 +1,41 @@
Scriptname _00E_Func_SafeMove Hidden
Function SafeMoveTo(ObjectReference refToMove, ObjectReference targetRef, Bool bFadeIn = False) Global
; A safer way to move an object reference to another ref than just MoveTo.
; Mostly for actors to take their intended positions.
; It's better for the actor to be already running a package that moves them to targetRef at the moment this function is called.
refToMove.Disable()
refToMove.MoveTo(targetRef)
refToMove.Enable(bFadeIn)
EndFunction
Function SafeMoveTo_NoWait(ObjectReference refToMove, ObjectReference targetRef, Bool bFadeIn = False) Global
; A safer way to move an object reference to another ref than just MoveTo (without waiting for it to be fully enabled).
; Mostly for actors to take their intended positions.
; It's better for the actor to be already running a package that moves them to targetRef at the moment this function is called.
refToMove.Disable()
refToMove.MoveTo(targetRef)
refToMove.EnableNoWait(bFadeIn)
EndFunction
Bool Function DistanceFailsafeMoveTo(ObjectReference refToMove, ObjectReference targetRef, Float fTooFarDistance) Global
; Moves refToMove to targetRef if refToMove is not within fTooFarDistance from targetRef.
; Mostly for character travel failsafes in scenes.
; Debug.Trace("FailsafeMoveTo: refToMove = " + refToMove + "; d = " + refToMove.GetDistance(targetRef))
If refToMove.GetDistance(targetRef) >= fTooFarDistance
refToMove.MoveTo(targetRef)
; Debug.Trace("FailsafeMoveTo: refToMove = " + refToMove + " force-moved to marker")
Return True
Else
Return False
EndIf
EndFunction

@ -175,10 +175,10 @@ Function SetNewWaypoint(Int iNewWaypoint, Bool bDoTeleport, Float fNextUpdateTim
CurrentWaypoint = iNewWaypoint
If teleportLuterRef
_00E_QuestFunctions.SafeMoveTo(luter, teleportLuterRef)
_00E_Func_SafeMove.SafeMoveTo(luter, teleportLuterRef)
EndIf
If teleportDancerRef
_00E_QuestFunctions.SafeMoveTo(dancer, teleportDancerRef)
_00E_Func_SafeMove.SafeMoveTo(dancer, teleportDancerRef)
EndIf
luter.EvaluatePackage()
If dancer
@ -209,7 +209,7 @@ Function GroupTravelFailsafe()
Actor luter = Alias_LutePlayer.GetActorReference()
Actor dancer = Alias_Dancer.GetActorReference()
If luter && dancer && dancer.GetDistance(luter) >= 1024.0 && dancer.GetDistance(PlayerRef) > 4000.0
_00E_QuestFunctions.SafeMoveTo_NoWait(dancer, luter)
_00E_Func_SafeMove.SafeMoveTo_NoWait(dancer, luter)
EndIf
EndIf
EndFunction

@ -41,19 +41,19 @@ Function SetUp()
_00E_SilenceAbruptHighPriority.Add()
Levelsystem.SetAllowIdleChatter(False)
SafeMoveTo_NoWait(_00E_MC_JesparREF, MQ06_SC1_JesparStartMarker)
_00E_Func_SafeMove.SafeMoveTo_NoWait(_00E_MC_JesparREF, MQ06_SC1_JesparStartMarker)
Dunwar.ForceRefIfEmpty(_00E_MQ05_DunwarREF)
SafeMoveTo_NoWait(_00E_MQ05_DunwarREF, MQ06_SC2_DunwarPortMarker)
_00E_Func_SafeMove.SafeMoveTo_NoWait(_00E_MQ05_DunwarREF, MQ06_SC2_DunwarPortMarker)
_00E_MQ05_DunwarREF.BlockActivation(True)
_00E_MQ05_DunwarREF.SetUnconscious(False)
_00E_MQ05_DunwarREF.SetOutfit(_00E_MC_Calia_SimpleClothingBarefeet)
_00E_MQ05_DunwarREF.MoveTo(MQ06_SC2_DunwarBedREF)
_00E_MQ05_DunwarREF.EvaluatePackage()
SafeMoveTo_NoWait(_00E_MC_NataraREF, MQ06_SC1_NataraAppearMarker)
SafeMoveTo_NoWait(_00E_MC_CaliaREF, MQ06_SC1_CaliaStartMarker)
SafeMoveTo_NoWait(_00E_MC_TealorREF, MQ06_SC1_TealorMarker)
SafeMoveTo_NoWait(MQ06_KonstantinREF, MQ06_SC1_KonstantinWalkMarker)
_00E_Func_SafeMove.SafeMoveTo_NoWait(_00E_MC_NataraREF, MQ06_SC1_NataraAppearMarker)
_00E_Func_SafeMove.SafeMoveTo_NoWait(_00E_MC_CaliaREF, MQ06_SC1_CaliaStartMarker)
_00E_Func_SafeMove.SafeMoveTo_NoWait(_00E_MC_TealorREF, MQ06_SC1_TealorMarker)
_00E_Func_SafeMove.SafeMoveTo_NoWait(MQ06_KonstantinREF, MQ06_SC1_KonstantinWalkMarker)
If MQ06_SiriusREF.IsDisabled()
MQ06_SiriusREF.Enable()
@ -272,8 +272,8 @@ Function SetUpReal()
SkyrimOvercastRain.ForceActive(True)
Levelsystem.SkipTimeToHour(22.5)
SafeMoveTo_NoWait(_00E_MQ05_DunwarREF, MQ06_SC2_DunwarBedREF)
SafeMoveTo_NoWait(_00E_MC_CaliaREF, MQ06_SC2_CaliaLean)
_00E_Func_SafeMove.SafeMoveTo_NoWait(_00E_MQ05_DunwarREF, MQ06_SC2_DunwarBedREF)
_00E_Func_SafeMove.SafeMoveTo_NoWait(_00E_MC_CaliaREF, MQ06_SC2_CaliaLean)
_00E_MC_CaliaREF.SetOutfit(_00E_MC_Calia_SimpleClothingBarefeet)
_00E_MC_CaliaREF.UnEquipItem(_00E_MC_CaliaREF.GetEquippedWeapon())

@ -773,7 +773,7 @@ EndFunction
Function TeleportYuslanToGate()
Wait(2)
_00E_QuestFunctions.SafeMoveTo(_00E_MC_YuslanRef, MQ12b_SC12_YuslanTeleportMarker)
_00E_Func_SafeMove.SafeMoveTo(_00E_MC_YuslanRef, MQ12b_SC12_YuslanTeleportMarker)
_00E_QuestFunctions.WaitForReferenceToLoad(_00E_MC_YuslanRef)
TimeFadeIn01FXS.Play(_00E_MC_YuslanRef)
Debug.sendAnimationEvent(_00E_MC_YuslanRef, "IdleWebEnterInstant")

@ -33,7 +33,7 @@ EndFunction
Function FinishQuest()
; Start end travel for Eshra
Actor akEshra = Alias_Eshra.GetActorRef()
_00E_QuestFunctions.DistanceFailsafeMoveTo(Alias_Elfride.GetActorRef(), akEshra, 256.0)
_00E_Func_SafeMove.DistanceFailsafeMoveTo(Alias_Elfride.GetActorRef(), akEshra, 256.0)
akEshra.SetAV("Variable01", 1.0)
RegisterForSingleUpdateGameTime(1.0)

@ -172,46 +172,6 @@ Function RefreshFace() Global
EndFunction
Function SafeMoveTo(ObjectReference refToMove, ObjectReference targetRef, Bool bFadeIn = False) Global
; A safer way to move an object reference to another ref than just MoveTo.
; Mostly for actors to take their intended positions.
; It's better for the actor to be already running a package that moves them to targetRef at the moment this function is called.
refToMove.Disable()
refToMove.MoveTo(targetRef)
refToMove.Enable(bFadeIn)
EndFunction
Function SafeMoveTo_NoWait(ObjectReference refToMove, ObjectReference targetRef, Bool bFadeIn = False) Global
; A safer way to move an object reference to another ref than just MoveTo (without waiting for it to be fully enabled).
; Mostly for actors to take their intended positions.
; It's better for the actor to be already running a package that moves them to targetRef at the moment this function is called.
refToMove.Disable()
refToMove.MoveTo(targetRef)
refToMove.EnableNoWait(bFadeIn)
EndFunction
Bool Function DistanceFailsafeMoveTo(ObjectReference refToMove, ObjectReference targetRef, Float fTooFarDistance) Global
; Moves refToMove to targetRef if refToMove is not within fTooFarDistance from targetRef.
; Mostly for character travel failsafes in scenes.
; Debug.Trace("FailsafeMoveTo: refToMove = " + refToMove + "; d = " + refToMove.GetDistance(targetRef))
If refToMove.GetDistance(targetRef) >= fTooFarDistance
refToMove.MoveTo(targetRef)
; Debug.Trace("FailsafeMoveTo: refToMove = " + refToMove + " force-moved to marker")
Return True
Else
Return False
EndIf
EndFunction
Function WaitForReferenceToLoad(ObjectReference ref) Global
Int maxIterationsToWait = 180

Loading…
Cancel
Save