Difference between revisions of "OnPlayerCameraState - ScriptObject"

From the Fallout4 CreationKit Wiki
Jump to navigation Jump to search
imported>Qazaaq
(added f4se member)
 
imported>Qazaaq
(added description)
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{Template:Incomplete Article}}
'''F4SE Member of:''' [[ScriptObject Script]]
'''F4SE Member of:''' [[ScriptObject Script]]
{{Template:Papyrus:RequiredF4SE|version=0.3.1}}
{{Template:Papyrus:RequiredF4SE|version=0.3.1}}


Placeholder Description.
Event called when the players camera state has changed.
Register this script with [[RegisterForCameraState - ScriptObject|RegisterForCameraState]] to receive the event.


== Syntax ==
== Syntax ==
Line 11: Line 11:


== Parameters ==
== Parameters ==
*aiOldState: Placeholder Description.
*aiOldState: The players old camera state.
*aiNewState: Placeholder Description.
*aiNewState: The players new camera state.
 
== Camera 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


== Examples ==
== Examples ==
<source lang="papyrus">
<source lang="papyrus">
; Placeholder Code.
Event OnPlayerCameraState(int aiOldState, int aiNewState)
    Debug.Trace("The new state is "+aiNewState+" and the old state is "+aiOldState)
EndEvent
</source>
 
 
<source lang="papyrus">
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
</source>
</source>


== See Also ==
== See Also ==
*[[ScriptObject Script]]
*[[ScriptObject Script]]
*[[RegisterForCameraState - ScriptObject]]





Latest revision as of 19:39, 25 January 2018

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]