Advertisement
ThoraldGM

Fallout 4 spinning camera

Nov 9th, 2017
439
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.66 KB | None | 0 0
  1. Game.GetPlayer().SetGhost() ; IMPORTANT: Player immune to all damage!
  2.  
  3. If HH_DevTracking.GetValue() as Int == 1 ; If player wants dev messages
  4. If Game.GetPlayer().IsGhost() ; If player is a ghost,
  5. Debug.Notification("Hitchhiker: Player is a ghost!") ; display message
  6. EndIf
  7. EndIf
  8.  
  9. If HH_OptionTeleportSound.GetValue() as Int == 1 ; If player wants teleport sound,
  10. Int iInstanceID = OBJHijackerTeleportOut2DA.Play(Game.GetPlayer()) ; play teleport sound at player
  11. EndIf
  12.  
  13. DestinationMarker = Game.GetPlayer().PlaceAtMe(pXMarker) ; Dynamically spawn xmarker at player
  14. DestinationMarker.MoveTo(StaticRef, 250, 250, 500) ; Move marker to static ref with XYZ offsets
  15. DestinationMarker.MoveToNearestNavmeshLocation() ; Then move marker to nearest navmesh
  16. Game.GetPlayer().MoveTo(DestinationMarker) ; Move player to destination marker
  17.  
  18. If HH_OptionSpinCamera.GetValue() as Int == 1 ; If player wants spincam after teleport
  19. Bool FirstView = Game.GetPlayer().GetAnimationVariableBool("IsFirstPerson") ; Is player in first person view?
  20.  
  21. If FirstView ; If yes,
  22. PreSpinCameraView = 1 ; flag as first person (int declared earlier)
  23. Else
  24. PreSpinCameraView = 3 ; else flag as third person
  25. EndIf
  26.  
  27. Game.ForceThirdPerson() ; IMPORTANT: Must start/run spin in third person!
  28.  
  29. Utility.SetINIBool("bForceAutoVanityMode:Camera", true) ; Spin the idle camera around player
  30. EndIf
  31.  
  32. SpinSeconds = HH_OptionSpinDuration.GetValue() as Int ; Default is 20 seconds but player can change
  33. Utility.Wait(SpinSeconds) ; Wait specified number of seconds
  34. Game.GetPlayer().SetGhost(false) ; IMPORTANT: Undo player's temporary invulnerability
  35.  
  36. If HH_DevTracking.GetValue() as Int == 1 ; If player wants dev messages
  37. If Game.GetPlayer().IsGhost() == false ; If player is no longer a ghost,
  38. Debug.Notification("Hitchhiker: Player is not a ghost.") ; display message
  39. EndIf
  40. EndIf
  41.  
  42. If HH_OptionSpinCamera.GetValue() as Int == 1 ; If player is spinning,
  43. Utility.SetINIBool("bForceAutoVanityMode:Camera", false) ; stop spinning
  44.  
  45. Game.ForceFirstPerson() ; IMPORTANT: Call this or spin will last forever!
  46.  
  47. If PreSpinCameraView == 3 ; If player preferred third person view,
  48. Game.ForceThirdPerson() ; can resume third now that spin handling is done
  49. EndIf
  50.  
  51. Game.GetPlayer().ResetHealthAndLimbs() ; Undo any damage taken during spin (obsolete by ghost?)
  52.  
  53. EndIf ; Done with optional spincam effect
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement