1,482
edits
(Unprofessional writing) |
m (Convert source tags to syntaxhighlight) |
||
| Line 17: | Line 17: | ||
=== Examples === | === Examples === | ||
< | <syntaxhighlight lang="papyrus"> | ||
; A simple activate event handler | ; A simple activate event handler | ||
Event OnActivate(ObjectReference akActivator) | Event OnActivate(ObjectReference akActivator) | ||
PlayAnimation("CoolStuff") | PlayAnimation("CoolStuff") | ||
endEvent | endEvent | ||
</ | </syntaxhighlight> | ||
== Special Variables == | == Special Variables == | ||
| Line 36: | Line 36: | ||
For example: | For example: | ||
< | <syntaxhighlight lang="papyrus"> | ||
Event OnHit(ObjectReference akAggressor, Form akWeapon, Projectile akProjectile) | Event OnHit(ObjectReference akAggressor, Form akWeapon, Projectile akProjectile) | ||
EndEvent | EndEvent | ||
</ | </syntaxhighlight> | ||
You might be tempted to try something like this: | You might be tempted to try something like this: | ||
< | <syntaxhighlight lang="papyrus"> | ||
Event OnHit(Game.GetPlayer()) | Event OnHit(Game.GetPlayer()) | ||
;do something | ;do something | ||
EndEvent | EndEvent | ||
</ | </syntaxhighlight> | ||
'''However, that does NOT work.''' | '''However, that does NOT work.''' | ||
Instead what you need to do is something like this: | Instead what you need to do is something like this: | ||
< | <syntaxhighlight lang="papyrus"> | ||
Event OnHit(ObjectReference akAggressor, Form akWeapon, Projectile akProjectile) | Event OnHit(ObjectReference akAggressor, Form akWeapon, Projectile akProjectile) | ||
if akAggressor != game.getPlayer() | if akAggressor != game.getPlayer() | ||
| Line 58: | Line 58: | ||
;do something | ;do something | ||
EndEvent | EndEvent | ||
</ | </syntaxhighlight> | ||
== See Also == | == See Also == | ||