RegisterForModEvent - Form
From Creation Kit
Registers a custom event callback for given event name. Registrations have to be refreshed after each game load.
Function RegisterForModEvent(string eventName, string callbackName) native ;The event: Event callbackName(string eventName, string strArg, float numArg, Form sender) EndEvent
- eventName: The name of the event sent by SendModEvent.
- callbackName: The name by which you can catch the event.
; 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
- Aliases and quests will automatically unregister for this event when the quest stops. Active magic effects will automatically unregister when they are removed.
- You must register for ModEvents after every game load!