parent
9ae92313ef
commit
6c46a2350c
12 changed files with 54 additions and 54 deletions
Binary file not shown.
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 |
Loading…
Reference in new issue