class Hat_AnimNotify_PlayCameraAnim extends AnimNotify_Scripted; /* This custom animation notify allows you to play CameraAnims directly from animations in an AnimSet, without the need for a separate script or kismet setup. The option CreateNewCamera should be used if this notify is being played in a non-player mesh, in case of use in a cutscene, for example. The variable tooltips go into further detail as for this notifies options. UltraBoo 2024 */ var array animInst; var DynamicCameraActor tempCamera; struct CinematicModeParams { var() bool bHidePlayer; var() bool bAffectsHUD; var() bool bAffectsMovement; var() bool bAffectsTurning; var() bool bAffectsButtons; var() bool bNewCamRot; var() bool bHideCinematicBars; }; var() CameraAnim CameraAnimation; var() float AnimRate; var() float AnimMoveScale; var() Vector2D BlendInOutTime; var() bool UseCinematicMode; var() CinematicModeParams CinematicModeSettings; var() bool CreateNewCamera; var(NewCamera) Rotator NewCameraRotation; var(NewCamera) Vector NewCameraPosition; var(NewCamera) ViewTargetTransitionParams NewCamSettings; event Notify(Actor Owner, AnimNodeSequence AnimSeqInstigator) { local Hat_PlayerController plyControl; local WorldInfo WI; local bool canHideCinematic; local int i; if(CameraAnimation == none) return; if(Hat_Player(Owner) != none && CinematicModeSettings.bHidePlayer) canHideCinematic = true; else canHideCinematic = false; i = 0; if(CreateNewCamera) { tempCamera = Owner.Spawn(class'DynamicCameraActor',,, Owner.Location + QuatRotateVector(QuatFromRotator(Owner.Rotation),NewCameraPosition), Owner.Rotation + NewCameraRotation,,true); WI = class'WorldInfo'.static.GetWorldInfo(); foreach WI.AllControllers(class'Hat_PlayerController', plyControl) { plyControl.PlayerCamera.SetViewTarget(tempCamera, NewCamSettings); animInst[i] = plyControl.PlayerCamera.PlayCameraAnim(CameraAnimation,AnimRate,AnimMoveScale,BlendInOutTime.X, BlendInOutTime.Y, false, false); if(UseCinematicMode) { if(CinematicModeSettings.bHideCinematicBars) plyControl.HideCinematicBars = true; plyControl.SetCinematicMode(true,canHideCinematic,CinematicModeSettings.bAffectsHUD,CinematicModeSettings.bAffectsMovement,CinematicModeSettings.bAffectsTurning,CinematicModeSettings.bAffectsButtons); if (class'Hat_HUDMenu_SwapHat'.static.IsOpen(plyControl)) Hat_Player(plyControl.Pawn).BadgeSwitchDeactivate(); } i++; } } else { if (Hat_Player(Owner) == None) return; plyControl = Hat_PlayerController(Hat_Player(Owner).Controller); animInst[0] = plyControl.PlayerCamera.PlayCameraAnim(CameraAnimation,AnimRate,AnimMoveScale,BlendInOutTime.X, BlendInOutTime.Y, false, false); if(UseCinematicMode) { if(CinematicModeSettings.bNewCamRot) plyControl.SetRotation(Owner.Rotation + NewCameraRotation); if(CinematicModeSettings.bHideCinematicBars) plyControl.HideCinematicBars = true; plyControl.SetCinematicMode(true,false,CinematicModeSettings.bAffectsHUD,CinematicModeSettings.bAffectsMovement,CinematicModeSettings.bAffectsTurning,CinematicModeSettings.bAffectsButtons); if (class'Hat_HUDMenu_SwapHat'.static.IsOpen(plyControl)) Hat_Player(plyControl.Pawn).BadgeSwitchDeactivate(); } } } event NotifyEnd( Actor Owner, AnimNodeSequence AnimSeqInstigator ) { local Hat_PlayerController plyControl; local WorldInfo WI; local bool canHideCinematic; local int i; if(animInst.Length <= 0) return; if(Hat_Player(Owner) != none && CinematicModeSettings.bHidePlayer) canHideCinematic = true; else canHideCinematic = false; i = 0; if(CreateNewCamera) { WI = class'WorldInfo'.static.GetWorldInfo(); foreach WI.AllControllers(class'Hat_PlayerController', plyControl) { plyControl.PlayerCamera.SetViewTarget(plyControl.ViewTarget, NewCamSettings); plyControl.PlayerCamera.StopCameraAnim(animInst[i], true); if(UseCinematicMode) { plyControl.SetCinematicMode(false,canHideCinematic,CinematicModeSettings.bAffectsHUD,CinematicModeSettings.bAffectsMovement,CinematicModeSettings.bAffectsTurning,CinematicModeSettings.bAffectsButtons); if(CinematicModeSettings.bHideCinematicBars) plyControl.HideCinematicBars = false; } i++; } tempCamera.Destroy(); tempCamera = none; } else { if (Hat_Player(Owner) == None) return; plyControl = Hat_PlayerController(Hat_Player(Owner).Controller); plyControl.PlayerCamera.StopCameraAnim(animInst[0], true); if(UseCinematicMode) { plyControl.SetCinematicMode(false,false,CinematicModeSettings.bAffectsHUD,CinematicModeSettings.bAffectsMovement,CinematicModeSettings.bAffectsTurning,CinematicModeSettings.bAffectsButtons); if(CinematicModeSettings.bHideCinematicBars) plyControl.HideCinematicBars = false; } } AnimInst.Length = 0; } defaultproperties { NotifyColor=(R=100,G=255,B=170,A=255); AnimRate = 1; AnimMoveScale = 1; BlendInOutTime = (X = 0, Y = 0); UseCinematicMode = true; NewCameraRotation = (Pitch = 0, Yaw = 0, Roll = 0); NewCameraPosition = (X = 0, Y = 0, Z = 0); CreateNewCamera = false; }