Difference between revisions of "RegisterForActorAction - Form"

From the CreationKit Wiki
Jump to navigation Jump to search
imported>CraftySentinel
m (Clarified warning.)
m (touched up Example)
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
__NOTOC__ __NOEDITSECTION__
[[Category:Scripting]]
[[Category:Scripting]]
[[Category:Papyrus]]
[[Category:Papyrus]]
[[Category:SKSE]]
'''SKSE Member of:''' [[Form Script]]
'''SKSE Member of:''' [[Form Script]]


{{WarningBox|This function only registers for actions performed by the player's actor, while it can be used on any form it will always be the player's actor's actions that are being registered.}}<br />
Registers the calling form to listen for the specified actor action via [[OnActorAction - Form|OnActorAction]].
Registers the calling form to listen for the specified actor action via [[OnActorAction - Form|OnActorAction]].
 
=== Syntax ===
== Syntax ==
<source lang="papyrus">Function RegisterForActorAction(int actionType) Native</source>
<source lang="papyrus">Function RegisterForActorAction(int actionType) Native</source>


 
=== Parameters ===
== Examples ==
*actionType - The following integers are valid:
<source lang="papyrus">
RegisterforActorAction(0);Registers the form for Weapon Swings
</source>
 
== Notes ==
* The following actionTypes are valid:
** 0 - Weapon Swing (Melee weapons that are swung including Hand to Hand.)
** 0 - Weapon Swing (Melee weapons that are swung including Hand to Hand.)
** 1 - Spell Cast (Spells and staves).
** 1 - Spell Cast (Spells and staves).
Line 28: Line 22:
** 9 - Sheathe Begin.
** 9 - Sheathe Begin.
** 10 - Sheathe End.
** 10 - Sheathe End.
=== Examples ===
<source lang="papyrus">
RegisterforActorAction(0) ; Registers the form for Weapon Swings
</source>
== Notes ==
*This function only registers for actions performed by the player's actor, while it can be used on any form it will always be the player's actor's actions that are being registered.
*Weapons will trigger Draw Begin & Draw End when drawn - but spells will only trigger Draw End. Similarly, weapons will trigger Sheathe Begin & Sheathe End when sheathed, but spells will only trigger Sheathe End.


== See Also ==
== See Also ==

Latest revision as of 22:01, 1 December 2021

SKSE Member of: Form Script

Registers the calling form to listen for the specified actor action via OnActorAction.

Syntax

Function RegisterForActorAction(int actionType) Native

Parameters

  • actionType - The following integers are valid:
    • 0 - Weapon Swing (Melee weapons that are swung including Hand to Hand.)
    • 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 - Draw Begin.
    • 8 - Draw End.
    • 9 - Sheathe Begin.
    • 10 - Sheathe End.

Examples

RegisterforActorAction(0) ; Registers the form for Weapon Swings

Notes

  • This function only registers for actions performed by the player's actor, while it can be used on any form it will always be the player's actor's actions that are being registered.
  • Weapons will trigger Draw Begin & Draw End when drawn - but spells will only trigger Draw End. Similarly, weapons will trigger Sheathe Begin & Sheathe End when sheathed, but spells will only trigger Sheathe End.

See Also