ProjectileData
Stores properties for an individual projectile type.
Callbacks
void
onExplode(Projectile proj, Point3F pos, float fade)
Called when a projectile explodes.
void
onCollision(Projectile proj, SceneObject col, float fade, Point3F pos, Point3F normal)
Called when a projectile collides with another object.
Public Attributes
int
Amount of time, in milliseconds, before the projectile will cause damage or explode on impact.
float
Influences post-bounce velocity of a projectile that does not explode on contact.
float
Factor to reduce post-bounce velocity of a projectile that does not explode on contact.
int
Amount of time, in milliseconds, before the projectile begins to fade out.
float
Scales the influence of gravity on the projectile.
float
bool
Detetmines if the projectile should be affected by gravity and whether or not it bounces before exploding.
int
Amount of time, in milliseconds, before the projectile is removed from the simulation.
LightDescription datablock used for lights attached to the projectile.
float
Amount of velocity the projectile recieves from the "muzzle" of the gun.
Particle emitter datablock used to generate particles while the projectile is outside of water.
Particle emitter datablock used to generate particles while the projectile is submerged in water.
filename
File path to the model of the projectile.
Point3F
Scale to apply to the projectile's size.
float
Amount of velocity the projectile recieves from the source that created it.
Explosion datablock used when the projectile explodes underwater.
Detailed Description
Stores properties for an individual projectile type.
datablock ProjectileData(GrenadeLauncherProjectile) { projectileShapeName = "art/shapes/weapons/SwarmGun/rocket.dts"; directDamage = 30; radiusDamage = 30; damageRadius = 5; areaImpulse = 2000; explosion = GrenadeLauncherExplosion; waterExplosion = GrenadeLauncherWaterExplosion; decal = ScorchRXDecal; splash = GrenadeSplash; particleEmitter = GrenadeProjSmokeTrailEmitter; particleWaterEmitter = GrenadeTrailWaterEmitter; muzzleVelocity = 30; velInheritFactor = 0.3; armingDelay = 2000; lifetime = 10000; fadeDelay = 4500; bounceElasticity = 0.4; bounceFriction = 0.3; isBallistic = true; gravityMod = 0.9; lightDesc = GrenadeLauncherLightDesc; damageType = "GrenadeDamage"; };
Callbacks
onExplode(Projectile proj, Point3F pos, float fade)
Called when a projectile explodes.
This function is only called on server objects. Parameters:
proj | The exploding projectile. |
pos | The position of the explosion. |
fade | The current fadeValue of the projectile, affects its visibility. |
onCollision(Projectile proj, SceneObject col, float fade, Point3F pos, Point3F normal)
Called when a projectile collides with another object.
This function is only called on server objects.Parameters:
proj | The projectile colliding with SceneObject col. |
col | The SceneObject hit by the projectile. |
fade | The current fadeValue of the projectile, affects its visibility. |
pos | The position of the collision. |
normal | The normal of the collision. |
Public Attributes
int armingDelay
Amount of time, in milliseconds, before the projectile will cause damage or explode on impact.
This value must be equal to or less than the projectile's lifetime.
float bounceElasticity
Influences post-bounce velocity of a projectile that does not explode on contact.
Scales the velocity from a bounce after friction is taken into account. A value of 1.0 will leave it's velocity unchanged while values greater than 1.0 will increase it.
float bounceFriction
Factor to reduce post-bounce velocity of a projectile that does not explode on contact.
Reduces bounce velocity by this factor and a multiple of the tangent to impact. Used to simulate surface friction.
DecalData decal
Decal datablock used for decals placed at projectile explosion points.
ExplosionData Explosion
Explosion datablock used when the projectile explodes outside of water.
int fadeDelay
Amount of time, in milliseconds, before the projectile begins to fade out.
This value must be smaller than the projectile's lifetime to have an affect.
float gravityMod
Scales the influence of gravity on the projectile.
The larger this value is, the more that gravity will affect the projectile. A value of 1.0 will assume "normal" influence upon it. The magnitude of gravity is assumed to be 9.81 m/s/s
note:ProjectileData::isBallistic must be true for this to have any affect.
float impactForce
bool isBallistic
Detetmines if the projectile should be affected by gravity and whether or not it bounces before exploding.
int lifetime
Amount of time, in milliseconds, before the projectile is removed from the simulation.
Used with fadeDelay to determine the transparency of the projectile at a given time. A projectile may exist up to a maximum of 131040ms (or 4095 ticks) as defined by Projectile::MaxLivingTicks in the source code.
LightDescription lightDesc
LightDescription datablock used for lights attached to the projectile.
float muzzleVelocity
Amount of velocity the projectile recieves from the "muzzle" of the gun.
Used with velInheritFactor to determine the initial velocity of the projectile. This value is never modified by the engine.
note:This value by default is not transmitted between the server and the client.
ParticleEmitterData ParticleEmitter
Particle emitter datablock used to generate particles while the projectile is outside of water.
note:If datablocks are defined for both particleEmitter and particleWaterEmitter, both effects will play as the projectile enters or leaves water.
ParticleEmitterData particleWaterEmitter
Particle emitter datablock used to generate particles while the projectile is submerged in water.
note:If datablocks are defined for both particleWaterEmitter and particleEmitter , both effects will play as the projectile enters or leaves water.
particleEmitter
filename projectileShapeName
File path to the model of the projectile.
Point3F scale
Scale to apply to the projectile's size.
note:This is applied after SceneObject::scale
SFXTrack sound
SFXTrack datablock used to play sounds while in flight.
SplashData Splash
Splash datablock used to create splash effects as the projectile enters or leaves water.
float velInheritFactor
Amount of velocity the projectile recieves from the source that created it.
Use an amount between 0 and 1 for the best effect. This value is never modified by the engine.
note:This value by default is not transmitted between the server and the client.
ExplosionData waterExplosion
Explosion datablock used when the projectile explodes underwater.