So I'm working on a weaponset, and I want the bullets to use a nifty particle tracer rather than a model (with a few exceptions that I'll get around to some other time). The problem is that the particle tracer isn't centered properly atop the bullet.
Sorry about the pagestretch but it's not really very visible otherwise.
That dot in the crook between the big star and the red bricks on the bottom right seems to be the actual bullet (or maybe that's just another particle and i forgeted up again)
Here's the relevant script:
datablock ParticleData(vnormalTrailParticle)
{
dragCoefficient = 3.0;
windCoefficient = 0.0;
gravityCoefficient = 0.0;
inheritedVelFactor = 0.0;
constantAcceleration = 0.0;
lifetimeMS = 120;
lifetimeVarianceMS = 0;
//spinSpeed = 10.0;
//spinRandomMin = -50.0;
//spinRandomMax = 50.0;
spinSpeed = 0.0;
spinRandomMin = 0.0;
spinRandomMax = 0.0;
useInvAlpha = false;
animateTexture = false;
//framesPerSec = 1;
textureName = "add-ons/Weapon_Vectorman/NormalShot";
//animTexName = "~/data/particles/dot";
// Interpolation variables
colors[0] = "1 1 1 1";
colors[1] = "1 1 1 1";
colors[2] = "1 1 1 1";
sizes[0] = 3.0;
sizes[1] = 3.0;
sizes[2] = 0.0;
times[0] = 0.0;
times[1] = 0.5;
times[2] = 1.0;
};
//So as it turns out, trail particles tend to hang out in one corner of their respective projectiles. I'm not thrilled.
datablock ParticleEmitterData(vnormalTrailEmitter)
{
ejectionPeriodMS = 1; //was 2, i changed this
periodVarianceMS = 0;
ejectionVelocity = 0; //0.25;
velocityVariance = 0; //0.10;
ejectionOffset = 0;
thetaMin = 0.0;
thetaMax = 0.0; //was 90.0?
particles = vnormalTrailParticle;
useEmitterColors = true;
};
AddDamageType("vnormal", '<bitmap:add-ons/Weapon_Vectorman/CI_normal> %1', '%2 <bitmap:add-ons/Weapon_Vectorman/CI_normal> %1',0.2,1);
datablock ProjectileData(vnormalProjectile)
{
projectileShapeName = "add-ons/Weapon_Gun/bullet.dts";
directDamage = 30;
directDamageType = $DamageType::vnormal;
radiusDamageType = $DamageType::vnormal;
brickExplosionRadius = 0;
brickExplosionImpact = true; //destroy a brick if we hit it directly?
brickExplosionForce = 10;
brickExplosionMaxVolume = 1; //max volume of bricks that we can destroy
brickExplosionMaxVolumeFloating = 2; //max volume of bricks that we can destroy if they aren't connected to the ground
impactImpulse = 400;
verticalImpulse = 400;
explosion = vnormalExplosion;
particleEmitter = vnormalTrailEmitter; //bulletTrailEmitter;
muzzleVelocity = 150;
velInheritFactor = 1;
armingDelay = 00;
lifetime = 4000;
fadeDelay = 3500;
bounceElasticity = 0.5;
bounceFriction = 0.20;
isBallistic = false;
gravityMod = 0.0;
hasLight = false;
lightRadius = 3.0;
lightColor = "0 0 0.5";
uiName = "Vectorman Shot";
};
What am I doing wrong here? Is there an easier way to just stick a particle directly on a projectile? Is there something I'm missing here? How do I center a bullet trail particle, or better yet, how do I make a particle stay on a bullet?