diff --git a/scripts/fxcameraattachscript.pex b/scripts/fxcameraattachscript.pex index b6e64107..06224f9d 100644 Binary files a/scripts/fxcameraattachscript.pex and b/scripts/fxcameraattachscript.pex differ diff --git a/source/scripts/fxcameraattachscript.psc b/source/scripts/fxcameraattachscript.psc index c758e03e..0c0cbaf9 100644 --- a/source/scripts/fxcameraattachscript.psc +++ b/source/scripts/fxcameraattachscript.psc @@ -21,51 +21,33 @@ int Property timeLimit = 180 Auto ;=============================================== - EVENT ONTRIGGERENTER(ObjectReference akActionRef) - IF (akActionRef == getPlayer() as ObjectReference);new - if(CameraAttachFX) ; Block added by USKP 1.2.6 because apparently not everything is using the default values. - CameraAttachFX.Play(akActionRef, timeLimit) - ; ; debug.trace("Triggered by player") - EndIf - if (CameraAttachFX2) - CameraAttachFX2.Play(akActionRef, timeLimit) - endif - ;if (CrossfadeableISM) - ; CrossfadeableISM.ApplyCrossFade(2) - ;endif - if (LoopSound) - instanceID = LoopSound.Play(Self) - endif - ;wait (27) - endif ;new - ;goToState ("reset") - endEvent +EVENT ONTRIGGERENTER(ObjectReference akActionRef) +IF (akActionRef == getPlayer() as ObjectReference);new + if(CameraAttachFX) ; Block added by USKP 1.2.6 because apparently not everything is using the default values. + CameraAttachFX.Play(akActionRef, timeLimit) +; ; debug.trace("Triggered by player") + EndIf + if (CameraAttachFX2) + CameraAttachFX2.Play(akActionRef, timeLimit) + endif + ;if (CrossfadeableISM) + ; CrossfadeableISM.ApplyCrossFade(2) + ;endif + if LoopSound && Is3DLoaded() + instanceID = LoopSound.Play(Self) + endif + ;wait (27) +endif ;new + ;goToState ("reset") +endEvent - EVENT OnTriggerLeave(ObjectReference akActionRef) - IF (akActionRef == getPlayer() as ObjectReference) - if(CameraAttachFX) ; Block added by USKP 1.2.1 because apparently not everything is using the default values. - CameraAttachFX.Stop(akActionRef) - EndIf - if (CameraAttachFX2) - CameraAttachFX2.Stop(akActionRef) - endif - ;if (CrossfadeableISM) - ; ImageSpaceModifier.RemoveCrossFade(3) - ;endif - ;USKP 2.0.2 - Added check for invalid sound instance. - if (LoopSound && instanceID != 0) - StopInstance(instanceID) - endif - goToState ("waiting") - ENDIF - ENDEVENT - - EVENT OnUnLoad() +EVENT OnTriggerLeave(ObjectReference akActionRef) + IF (akActionRef == getPlayer() as ObjectReference) if(CameraAttachFX) ; Block added by USKP 1.2.1 because apparently not everything is using the default values. - CameraAttachFX.Stop(GetPlayer()) + CameraAttachFX.Stop(akActionRef) EndIf if (CameraAttachFX2) - CameraAttachFX2.Stop(GetPlayer()) + CameraAttachFX2.Stop(akActionRef) endif ;if (CrossfadeableISM) ; ImageSpaceModifier.RemoveCrossFade(3) @@ -75,4 +57,22 @@ int Property timeLimit = 180 Auto StopInstance(instanceID) endif goToState ("waiting") - ENDEVENT + ENDIF +ENDEVENT + +EVENT OnUnLoad() + if(CameraAttachFX) ; Block added by USKP 1.2.1 because apparently not everything is using the default values. + CameraAttachFX.Stop(GetPlayer()) + EndIf + if (CameraAttachFX2) + CameraAttachFX2.Stop(GetPlayer()) + endif + ;if (CrossfadeableISM) + ; ImageSpaceModifier.RemoveCrossFade(3) + ;endif + ;USKP 2.0.2 - Added check for invalid sound instance. + if (LoopSound && instanceID != 0) + StopInstance(instanceID) + endif + goToState ("waiting") +ENDEVENT