Difference between revisions of "RegisterForExternalEvent - ScriptObject"

added example
imported>Ice Eyes
m (→‎Parameters: Corrected parameter names and added brief descriptions.)
imported>Qazaaq
(added example)
 
(One intermediate revision by one other user not shown)
Line 3: Line 3:
{{Template:Papyrus:RequiredF4SE|version=0.3.1}}
{{Template:Papyrus:RequiredF4SE|version=0.3.1}}


Placeholder Description.
Callback is the function name that is called when the event is triggered.


== Syntax ==
== Syntax ==
<source lang="papyrus">
<source lang="papyrus">
Function RegisterForExternalEvent(string EventName, string Callback) Native
Function RegisterForExternalEvent(string eventName, string callback) Native
</source>
</source>


== Parameters ==
== Parameters ==
*EventName: The event name that you want to register for.
*eventName: The name of the event that you want to register for.
*Callback: The function name that is called when the event is triggered.
*callback: The function name that is called when the event is triggered.


== Return Value ==
== Return Value ==
Line 19: Line 19:
== Examples ==
== Examples ==
<source lang="papyrus">
<source lang="papyrus">
; Placeholder Code.
Scriptname ChildType extends BaseType
 
; The name of an external event.
string MyModResetEvent = "MyModResetEvent" const
 
Event OnQuestInit()
RegisterForExternalEvent(MyModResetEvent, "OnMyModReset")
EndEvent
 
Event OnMyModReset()
Debug.TraceSelf(self, "OnMyModReset", "We have the external event handled.")
EndEvent
 
</source>
 
<source lang="papyrus">
ScriptName BaseType extends Quest Native Const Hidden
 
Event OnMyModReset() Native
{New event declaration. Overrride in extending scripts.}
 
</source>
</source>


== See Also ==
== See Also ==
Anonymous user