Interface Projectiles
Projectiles interface
Usage
require('openmw.interfaces').Projectiles
Type Projectiles
| Projectiles.TYPES | |
| Projectiles.addOnProjectileHitHandler(type, handler) |
Add new projectile hit handler. |
Type ProjectileInfo
| ProjectileInfo.type | |
| ProjectileInfo.userData |
data that depends on #ProjectileType:
|
Type ProjectileType
Type Projectiles
Field(s)
- Projectiles.addOnProjectileHitHandler(type, handler)
-
Add new projectile hit handler.
If
handler(projectile, hitResult)returns false, other handlers for the same projectile will be skipped. Two handler parameters are a #ProjectileInfo and a openmw.nearby#RayCastingResult, respectively. Note that in the current revision hitResult.hit will always be true. In later interface revisions, when lua-spawned projectiles are introduced, hitResult.hit may be false to indicate to scripts that a lua-spawned projectile was despawned, and should therefore be checked anyway.Parameters
-
#string type: The type of projectile to handle (see ProjectileInfo.type) -
#function handler: The handler.
-
Type ProjectileInfo
Table describing a projectile.
This is the projectile info provided to projectile hit handlers.
Field(s)
- #table ProjectileInfo.userData
-
data that depends on #ProjectileType:
Magic- userData is a SpellCasting#SpellCastInfo
Type ProjectileType
Table of known projectile types.
This contains only 1 entry because only magic projectiles have been given lua handlers so far.
Field(s)
- #string ProjectileType.Magic