Difference between revisions of "Events Reference"
Jump to navigation
Jump to search
imported>Catwheezle (Added "see also" section.) |
imported>Catwheezle m (→See Also) |
||
Line 31: | Line 31: | ||
== See Also == | == See Also == | ||
[[Events]] | *[[Events]] | ||
[[Category:Scripting]] | [[Category:Scripting]] | ||
[[Category:Papyrus]] | [[Category:Papyrus]] | ||
[[Category:Papyrus Language Reference]] | [[Category:Papyrus Language Reference]] |
Revision as of 22:29, 14 February 2012
Events are special functions that the game will call when something happens. Note that simply defining an event won't make the game call it, you must follow the name and argument list of an event that the game already sends you.
Event Definition
<event> ::= <event header> [<function block> 'endEvent']
Function headers must always be followed by a standard function block and "EndEvent", unless they are native (which are handled by the game).
Event Header
<event header> ::= 'Event' <identifier> '(' [<parameters>] ')' ['Native'] <flags>*
The event header is identical to the function header, but does not allow for return types or allow for the "Global" flag.
Parameters
The parameters are identical to the function parameter list, but should match the data that the game will send to the event.
Examples
; A simple activate event handler
Event OnActivate(ObjectReference akActivator)
PlayAnimation("CoolStuff")
endEvent
Special Variables
Event special variables are identical to a non-global function's.
Calling Events
Calling events is identical to calling a function.