Editing
RegisterForModEvent - Form
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
[[Category:Scripting]] [[Category:Papyrus]] [[Category:SKSE]] '''SKSE Member of:''' [[ActiveMagicEffect Script]], [[Alias Script]], and [[Form Script]] Registers a custom event callback for given event name. Registrations have to be refreshed after each game load. == Syntax == <syntaxhighlight lang="papyrus"> Function RegisterForModEvent(string eventName, string callbackName) native ;The event: Event callbackName(string eventName, string strArg, float numArg, Form sender) EndEvent </syntaxhighlight> == Parameters == *eventName: The name of the event sent by [[SendModEvent]]. *callbackName: The name by which you can catch the event. == Examples == <syntaxhighlight lang="papyrus"> ; Register to receive the ModEvent: ; named HectorHitMe with the callback of OnHectorHitMe RegisterForModEvent("HectorHitMe", "OnHectorHitMe") Event OnHectorHitMe(string eventName, string strArg, float numArg, Form sender) ;Do something EndEvent </syntaxhighlight> == Notes == *Aliases and quests will automatically unregister for this event when the quest stops. Active magic effects will automatically unregister when they are removed. *ModEvent registrations are persistent and are stored in the MCBR record of the SKSE co-save. If you mod relies on these registrations being persistent it is '''strongly''' recommended that you register for the event again after each game load, if the user deletes this file for any reason it could break your mod.<sup>[1]</sup> == References == # [https://discordapp.com/channels/115334762415128585/316278100528857088/716726335372001391 Expired, xSE Discord, 31-05-2020]. == See Also == *[[ActiveMagicEffect Script]] *[[Alias Script]] *[[Form Script]] *[[SendModEvent]]
Summary:
Please note that all contributions to the CreationKit Wiki are considered to be released under the Creative Commons Attribution-ShareAlike (see
CreationKit:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
Page
Discussion
English
Views
Read
Edit
Edit source
View history
More
Search
Navigation
Landing page
Tutorials
Game Systems
Editor Reference
Scripting Reference
Recent changes
Help
Tools
What links here
Related changes
Special pages
Page information
Page values