ShowOff:OnProjectileCreate
An event handler added by the ShowOff NVSE Plugin version 1.50.
Description
This event runs whenever a projectile is being created. For example, it will run if an actor fired their weapon, as it will produce at least one projectile.
The event is flushed every time the game is loaded. Use a GetGameLoaded check or other method to re-register a handler.
Dispatched Args
GetSelf / GetSelfAlt will return the projectile reference that is being created.
The args dispatched to handlers are:
Syntax
Use SetEventHandler / SetEventHandlerAlt with the event name "ShowOff:OnProjectileCreate".
Handler Script
A skeleton handler script for this event:
scn OnProjectileCreateUDF begin Function { ref rProjOwner, ref rWeapon } ref rProjRef = GetSelfAlt ;* GetSelf would do the same thing ; do code end
Example
SetEventHandler "ShowOff:OnProjectileCreate" OnProjectileCreateUDF "first"::Player
Will register OnProjectileCreateUDF as an event handler for the event, and it should only be called if the projectile's owner is the Player.
SetEventHandlerAlt "ShowOff:OnProjectileCreate" OnProjectileCreateUDF 0::308BulletProjectile 1::Player
Will register OnProjectileCreateUDF as an event handler for the event, and it should only be called if the projectiles's BaseForm is 308BulletProjectile and the projectile's owner is the Player.
Notes
- This event will also run when creating a projectile through PlaceAtMe, in which case there will be no source actor reference, nor a source weapon if the projectile base form doesn't have a default one defined.