Editing Category:Events

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.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.

Latest revision Your text
Line 1: Line 1:
This category is a holding place for the various Papyrus Events. For a reference on Events: [[Events Reference]]
This category is a holding place for the various Papyrus Events.
 
For a reference on Events: [[Events Reference]]
 
=A note about events=
Events are not like the old block types. When you make an event in your script that extends ObjectReference or ReferenceAlias you are essentially creating a new version of that event, and you need to declare it with the same number of parameters. Those parameters are then used inside the script.
 
You should pretty much just copy and paste the events straight from the wiki, unless you desire to change the name of the parameters for some reason (but I can't think of a reason).
 
For example:
<source lang="papyrus">
Event OnHit(ObjectReference akAggressor, Form akWeapon, Projectile akProjectile)
EndEvent
</source>
You might be tempted to try something like this:
 
<source lang="papyrus">
Event OnHit(Game.GetPlayer())
EndEvent
</source>
'''But that DOES NOT work.'''
 
Instead what you need to do is something like this:
<source lang="papyrus">
Event OnHit(ObjectReference akAggressor, Form akWeapon, Projectile akProjectile)
if akAggressor == game.getPlayer()
;do something
endif
EndEvent
</source>


{{Languages|:Category:Events}}
{{Languages|:Category:Events}}
[[Category:Papyrus]]
[[Category:Papyrus]]

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)