OnPlayerCameraState - ScriptObject

From the Fallout4 CreationKit Wiki
Jump to navigation Jump to search

F4SE Member of: ScriptObject Script
Requires F4SE version 0.3.1 or higher.

Event called when the players camera state has changed. Register this script with RegisterForCameraState to receive the event.

Syntax[edit | edit source]

Event OnPlayerCameraState(int aiOldState, int aiNewState)

Parameters[edit | edit source]

  • aiOldState: The players old camera state.
  • aiNewState: The players new camera state.

Camera States[edit | edit source]

  • 0 - First Person
  • 1 - Auto Vanity
  • 2 - VATS
  • 3 - Free
  • 4 - Iron Sights
  • 5 - Transition
  • 6 - Tween Menu
  • 7 - ThirdPerson1
  • 8 - ThirdPerson2
  • 9 - Furniture
  • 10 - Horse
  • 11 - Bleedout
  • 12 - Dialogue

Examples[edit | edit source]

Event OnPlayerCameraState(int aiOldState, int aiNewState)
    Debug.Trace("The new state is "+aiNewState+" and the old state is "+aiOldState)
EndEvent


Scriptname Example

int FirstPersonState = 0 const
int AutoVanityState = 1 const
int VATSState = 2 const
int FreeState = 3 const
int IronSightsState = 4 const
int TransitionState = 5 const
int TweenMenuState = 6 const
int ThirdPerson1State = 7 const
int ThirdPerson2State = 8 const
int FurnitureState = 9 const
int HorseState = 10 const
int BleedoutState = 11 const
int DialogueState = 12 const

Event OnInit()
    RegisterForCameraState()
EndEvent

Event OnPlayerCameraState(int aiOldState, int aiNewState)
    If (aiNewState == FirstPersonState)
        Debug.Trace("The new camera state of "+aiNewState+" is the first person state.")
    ElseIf (aiNewState == AutoVanityState)
        Debug.Trace("The new camera state of "+aiNewState+" is the auto vanity state.")
    ElseIf (aiNewState == VATSState)
        Debug.Trace("The new camera state of "+aiNewState+" is the VATS state.")
    ElseIf (aiNewState == FreeState)
        Debug.Trace("The new camera state of "+aiNewState+" is the free state.")
    ElseIf (aiNewState == IronSightsState)
        Debug.Trace("The new camera state of "+aiNewState+" is the iron sights state.")
    ElseIf (aiNewState == TransitionState)
        Debug.Trace("The new camera state of "+aiNewState+" is the transition state.")
    ElseIf (aiNewState == TweenMenuState)
        Debug.Trace("The new camera state of "+aiNewState+" is the tween menu state.")
    ElseIf (aiNewState == ThirdPerson1State)
        Debug.Trace("The new camera state of "+aiNewState+" is the third person 1 state.")
    ElseIf (aiNewState == ThirdPerson2State)
        Debug.Trace("The new camera state of "+aiNewState+" is the third person 2 state.")
    ElseIf (aiNewState == FurnitureState)
        Debug.Trace("The new camera state of "+aiNewState+" is the furniture state.")
    ElseIf (aiNewState == HorseState)
        Debug.Trace("The new camera state of "+aiNewState+" is the horse state.")
    ElseIf (aiNewState == BleedoutState)
        Debug.Trace("The new camera state of "+aiNewState+" is the bleedout state.")
    ElseIf (aiNewState == DialogueState)
        Debug.Trace("The new camera state of "+aiNewState+" is the dialogue state.")
    Else
        Debug.Trace("Something went wrong, the new camera state of "+aiNewState+" is out of range.")
    EndIf
EndEvent

See Also[edit | edit source]