Background for Fallout 4
Member of the ScriptObject script
eventOnPlayerCameraState(intoldState, intnewState)

Description

Wiki Description

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

Documentation Comment

States
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


Parameters

  1. intoldState

    CK Wiki Description

    The players old camera state.

  2. intnewState

    CK Wiki Description

    The players new camera state.


Examples

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

Auto-Generated Example

Scriptname MyCoolScript extends ScriptObject

event OnPlayerCameraState(int oldState, int newState)
    Debug.trace("Event received - OnPlayerCameraState: oldState = " + oldState + " newState = " + newState)
endEvent

Related Pages


Additional References

View this event’s page on the Fallout 4 Creation Kit Wiki

Some data provided by the Fallout 4 Creation Kit Wiki. Licensed under the Creative Commons Attribution-Share Alike 4.0 license.