Difference between revisions of "OnActorAction - Form"

From the CreationKit Wiki
Jump to navigation Jump to search
imported>CraftySentinel
m (→‎Syntax: Extra ")")
imported>CraftySentinel
m (→‎Parameters: Grammar Corrections)
Line 9: Line 9:


== Parameters ==
== Parameters ==
*actionType - The actionType that triggered the event(See [[RegisterForActorAction - Form| RegisterForActorAction]] for a list of available action types.)
*actionType - The actionType that triggered the event (See [[RegisterForActorAction - Form| RegisterForActorAction]] for a list of available action types).
*akActor - The actor that triggered the event (Always the Player.)
*akActor - The actor that triggered the event (Always the Player).
*source - The Weapon or Spell that was used within the action
*source - The Weapon or Spell that was used within the action.
*slot - The slot of the source item. Valid Slots:
*slot - The slot of the source item. Valid Slots:
** 0 - Left Hand
** 0 - Left Hand
** 1 - Right Hand
** 1 - Right Hand
** 2 - Voice  
** 2 - Voice


== Return Value ==
== Return Value ==

Revision as of 11:43, 9 August 2013

SKSE Member of: Form Script

Listens for actor actions, for this event to be received the form must have been registered previously via RegisterForActorAction.

Syntax

Event OnActorAction(int actionType, Actor akActor, Form source, int slot)

Parameters

  • actionType - The actionType that triggered the event (See RegisterForActorAction for a list of available action types).
  • akActor - The actor that triggered the event (Always the Player).
  • 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

Return Value

None

Examples

Event OnInit()
	RegisterForActorAction(0);Register for melee swings.
EndEvent
 
Event OnActorAction(int actionType, Actor akActor, Form source, int slot)
	If !source ;Hand to Hand does not have a form of it's 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
EndEvent

See Also