ModEvent Script: Difference between revisions

Jump to navigation Jump to search
m
Convert source tags to syntaxhighlight
imported>Egocarib
mNo edit summary
m (Convert source tags to syntaxhighlight)
 
Line 6: Line 6:


== Definition ==
== Definition ==
<source lang="papyrus">
<syntaxhighlight lang="papyrus">
ScriptName ModEvent Hidden
ScriptName ModEvent Hidden
</source>
</syntaxhighlight>


== SKSE Global Functions ==
== SKSE Global Functions ==
Line 39: Line 39:


Script that is sending the event:
Script that is sending the event:
<source lang=papyrus>
<syntaxhighlight lang=papyrus>
SomeFunction()
SomeFunction()
     int handle = ModEvent.Create("ModPrefix_myCustomEvent")
     int handle = ModEvent.Create("ModPrefix_myCustomEvent")
Line 50: Line 50:
     endIf
     endIf
EndFunction
EndFunction
</source>
</syntaxhighlight>


Script that wishes to receive the event:
Script that wishes to receive the event:
<source lang=papyrus>
<syntaxhighlight lang=papyrus>
Function OnInit()
Function OnInit()
     RegisterForModEvent("ModPrefix_myCustomEvent", "OnMyCustomEvent") ;(remember to re-register for events each game reload)
     RegisterForModEvent("ModPrefix_myCustomEvent", "OnMyCustomEvent") ;(remember to re-register for events each game reload)
Line 68: Line 68:
     debug.trace(theString) ;prints "It worked!"
     debug.trace(theString) ;prints "It worked!"
EndEvent
EndEvent
</source>
</syntaxhighlight>




Navigation menu