- Found in:
- SKSE
Description
Wiki Description
Listens for actor actions. For this event to be received, the form must have been registered previously via Form.RegisterForActorAction(...).
Syntax
Event OnActorAction(int actionType, Actor akActor, Form source, int slot)
Parameters
-
actionType - The actionType that triggered the event (See Form.RegisterForActorAction(...) for a list of available action types).
-
akActor - The actor that triggered the event.
-
source - The Weapon or Spell that was used within the action.
-
slot - The slot of the source item. Valid Slots:
- 0 - Left Hand
- 1 - Right Hand
- 2 - Voice
Examples
Actor property PlayerRef auto
Event OnInit()
RegisterForActorAction(0);Register for melee swings.
EndEvent
Event OnActorAction(int actionType, Actor akActor, Form source, int slot)
if akActor == PlayerRef
If !source ;Hand to Hand does not have a form of its own so it will be none.
If !slot ;Left Hand slot
Debug.Trace("The player has swung their left fist.")
Else
Debug.Trace("The player has swung their right fist.")
EndIf
EndIf
Endif
EndEvent
Documentation Comment
ActionTypes
0 - Weapon Swing (Melee weapons that are swung, also barehand)
1 - Spell Cast (Spells and staves)
2 - Spell Fire (Spells and staves)
3 - Voice Cast
4 - Voice Fire
5 - Bow Draw
6 - Bow Release
7 - Unsheathe Begin
8 - Unsheathe End
9 - Sheathe Begin
10 - Sheathe End
Slots
0 - Left Hand
1 - Right Hand
2 - Voice
Caveats
CK Wiki - Notes
- This event cannot detect forms in the player's left hand when listening for Draw/Sheathe events (actionType 7-10). It will always return a value of 1 for slot (indicating the right hand), and the source will always only be whatever Form is wielded in the right hand (or NONE if there isn't something in the player's right hand).
Parameters
Examples
No human-generated examples found for this event.
Auto-Generated Example
Scriptname MyCoolScript extends Form
event OnActorAction(int actionType, Actor akActor, Form source, int slot)
Debug.trace("Event received - OnActorAction: actionType = " + actionType + " akActor = " + akActor + " source = " + source + " slot = " + slot)
endEvent