Mine Launcher December 19 2001, 3:03 PM Here ya go mugz. A few things: you might want to add your own MineFireSound, MineReloadSound, and MineDryFireSound. I didn't add those because i wasn't sure which sounds you wanted :-\ Anyways, i'm just giving you the mineLauncher.cs script because i know you know how to add it to the game. (NOTE: it uses ammo so you'll have to add that junk to...) // ---------------------------------------------- // Mine Launcher // - By Tiperus // ---------------------------------------------- $TeamDeployableMax[MineDeployed] = 20; // ---------------------------------------------- // force-feedback datablocks // ---------------------------------------------- datablock EffectProfile(MineSwitchEffect) { effectname = "weapons/mortar_activate"; minDistance = 2.5; maxDistance = 2.5; }; datablock EffectProfile(MineExplosionEffect) { effectname = "explosions/mine_detonate"; minDistance = 10; maxDistance = 50; }; // ---------------------------------------------- // audio datablocks // ---------------------------------------------- datablock AudioProfile(MineSwitchSound) { filename = "fx/weapons/mortar_activate.wav"; description = AudioClosest3d; preload = true; effect = MineSwitchEffect; }; datablock AudioProfile(MineDeploySound) { filename = "fx/weapons/mine_deploy.wav"; description = AudioClose3D; preload = true; }; datablock AudioProfile(MineExplosionSound) { filename = "fx/weapons/mine_detonate.wav"; description = AudioBIGExplosion3d; preload = true; effect = MineExplosionEffect; }; datablock AudioProfile(UnderwaterMineExplosionSound) { filename = "fx/weapons/mine_detonate_UW.wav"; description = AudioBIGExplosion3d; preload = true; effect = MineExplosionEffect; }; datablock AudioProfile(MineProjectileSound) { filename = "fx/weapons/grenadelauncher_projectile.wav"; description = ProjectileLooping3d; preload = true; }; //-------------------------------------------------------------------------- // Mine Particle effects //-------------------------------------------------------------------------- datablock ParticleData(MineExplosionBubbleParticle) { dragCoefficient = 0.0; gravityCoefficient = -0.25; inheritedVelFactor = 0.0; constantAcceleration = 0.0; lifetimeMS = 2000; lifetimeVarianceMS = 750; useInvAlpha = false; textureName = "special/bubbles"; spinRandomMin = -100.0; spinRandomMax = 100.0; colors[0] = "0.7 0.8 1.0 0.0"; colors[1] = "0.7 0.8 1.0 0.4"; colors[2] = "0.7 0.8 1.0 0.0"; sizes[0] = 1.0; sizes[1] = 1.0; sizes[2] = 1.0; times[0] = 0.0; times[1] = 0.3; times[2] = 1.0; }; datablock ParticleEmitterData(MineExplosionBubbleEmitter) { ejectionPeriodMS = 7; periodVarianceMS = 0; ejectionVelocity = 1.0; ejectionOffset = 2.0; velocityVariance = 0.5; thetaMin = 0; thetaMax = 80; phiReferenceVel = 0; phiVariance = 360; overrideAdvances = false; particles = "MineExplosionBubbleParticle"; }; datablock ParticleData( UnderwaterMineCrescentParticle ) { dragCoefficient = 2; gravityCoefficient = 0.0; inheritedVelFactor = 0.2; constantAcceleration = -0.0; lifetimeMS = 600; lifetimeVarianceMS = 000; textureName = "special/crescent3"; colors[0] = "0.5 0.5 1.0 1.0"; colors[1] = "0.5 0.5 1.0 1.0"; colors[2] = "0.5 0.5 1.0 0.0"; sizes[0] = 0.5; sizes[1] = 1.0; sizes[2] = 2.0; times[0] = 0.0; times[1] = 0.5; times[2] = 1.0; }; datablock ParticleEmitterData( UnderwaterMineCrescentEmitter ) { ejectionPeriodMS = 10; periodVarianceMS = 0; ejectionVelocity = 10; velocityVariance = 5.0; ejectionOffset = 0.0; thetaMin = 0; thetaMax = 80; phiReferenceVel = 0; phiVariance = 360; overrideAdvances = false; orientParticles = true; lifetimeMS = 200; particles = "UnderwaterMineCrescentParticle"; }; datablock ParticleData(UnderwaterMineExplosionSmoke) { dragCoeffiecient = 105.0; gravityCoefficient = -0.0; inheritedVelFactor = 0.025; constantAcceleration = -1.0; lifetimeMS = 1200; lifetimeVarianceMS = 00; textureName = "particleTest"; useInvAlpha = false; spinRandomMin = -200.0; spinRandomMax = 200.0; textureName = "special/Smoke/smoke_001"; colors[0] = "0.7 0.7 1.0 1.0"; colors[1] = "0.3 0.3 1.0 1.0"; colors[2] = "0.0 0.0 1.0 0.0"; sizes[0] = 1.0; sizes[1] = 3.0; sizes[2] = 1.0; times[0] = 0.0; times[1] = 0.5; times[2] = 1.0; }; datablock ParticleEmitterData(UnderwaterMineExplosionSmokeEmitter) { ejectionPeriodMS = 8; periodVarianceMS = 0; ejectionVelocity = 4.25; velocityVariance = 1.25; thetaMin = 0.0; thetaMax = 80.0; lifetimeMS = 250; particles = "UnderwaterMineExplosionSmoke"; }; datablock ExplosionData(UnderwaterMineExplosion) { explosionShape = "disc_explosion.dts"; playSpeed = 1.0; sizes[0] = "0.4 0.4 0.4"; sizes[1] = "0.4 0.4 0.4"; soundProfile = UnderwaterMineExplosionSound; faceViewer = true; emitter[0] = UnderwaterMineExplosionSmokeEmitter; emitter[1] = UnderwaterMineCrescentEmitter; emitter[2] = MineExplosionBubbleEmitter; shakeCamera = true; camShakeFreq = "8.0 7.0 9.0"; camShakeAmp = "50.0 50.0 50.0"; camShakeDuration = 1.0; camShakeRadius = 10.0; }; //-------------------------------------------------------------------------- // Mine Particle effects //-------------------------------------------------------------------------- datablock ParticleData( MineCrescentParticle ) { dragCoefficient = 2; gravityCoefficient = 0.0; inheritedVelFactor = 0.2; constantAcceleration = -0.0; lifetimeMS = 600; lifetimeVarianceMS = 000; textureName = "special/crescent3"; colors[0] = "1.0 0.8 0.2 1.0"; colors[1] = "1.0 0.4 0.2 1.0"; colors[2] = "1.0 0.0 0.0 0.0"; sizes[0] = 0.5; sizes[1] = 1.0; sizes[2] = 2.0; times[0] = 0.0; times[1] = 0.5; times[2] = 1.0; }; datablock ParticleEmitterData( MineCrescentEmitter ) { ejectionPeriodMS = 10; periodVarianceMS = 0; ejectionVelocity = 10; velocityVariance = 5.0; ejectionOffset = 0.0; thetaMin = 0; thetaMax = 80; phiReferenceVel = 0; phiVariance = 360; overrideAdvances = false; orientParticles = true; lifetimeMS = 200; particles = "MineCrescentParticle"; }; datablock ParticleData(MineExplosionSmoke) { dragCoeffiecient = 105.0; gravityCoefficient = -0.0; inheritedVelFactor = 0.025; lifetimeMS = 1200; lifetimeVarianceMS = 00; textureName = "particleTest"; useInvAlpha = true; spinRandomMin = -200.0; spinRandomMax = 200.0; textureName = "special/Smoke/smoke_001"; colors[0] = "1.0 0.7 0.0 1.0"; colors[1] = "0.2 0.2 0.2 1.0"; colors[2] = "0.0 0.0 0.0 0.0"; sizes[0] = 1.0; sizes[1] = 3.0; sizes[2] = 1.0; times[0] = 0.0; times[1] = 0.5; times[2] = 1.0; }; datablock ParticleEmitterData(MineExplosionSmokeEmitter) { ejectionPeriodMS = 8; periodVarianceMS = 0; ejectionVelocity = 4.25; velocityVariance = 1.25; thetaMin = 0.0; thetaMax = 80.0; lifetimeMS = 250; particles = "MineExplosionSmoke"; }; datablock ExplosionData(MineExplosion) { explosionShape = "effect_plasma_explosion.dts"; playSpeed = 1.0; sizes[0] = "0.5 0.5 0.5"; sizes[1] = "0.5 0.5 0.5"; soundProfile = MineExplosionSound; faceViewer = true; emitter[0] = MineExplosionSmokeEmitter; emitter[1] = MineCrescentEmitter; shakeCamera = true; camShakeFreq = "8.0 7.0 9.0"; camShakeAmp = "50.0 50.0 50.0"; camShakeDuration = 1.0; camShakeRadius = 10.0; }; //--------------------------------------------------------------------------- // Smoke particles //--------------------------------------------------------------------------- datablock ParticleData(MineSmokeParticle) { dragCoeffiecient = 0.4; gravityCoefficient = -0.3; // rises slowly inheritedVelFactor = 0.125; lifetimeMS = 1200; lifetimeVarianceMS = 200; useInvAlpha = true; spinRandomMin = -100.0; spinRandomMax = 100.0; animateTexture = false; textureName = "special/Smoke/bigSmoke"; colors[0] = "0.102 0.102 0.102 0.5"; colors[1] = "0.102 0.102 0.102 0.8"; colors[2] = "0.102 0.102 0.102 0.7"; sizes[0] = 1.0; sizes[1] = 2.0; sizes[2] = 4.5; times[0] = 0.0; times[1] = 0.5; times[2] = 1.0; }; datablock ParticleEmitterData(MineSmokeEmitter) { ejectionPeriodMS = 10; periodVarianceMS = 3; ejectionVelocity = 2.25; velocityVariance = 0.55; thetaMin = 0.0; thetaMax = 40.0; particles = "MineSmokeParticle"; }; //-------------------------------------------------------------------------- // Projectile //-------------------------------------- datablock GrenadeProjectileData(MLMine) { projectileShapeName = "mine.dts"; emitterDelay = -1; directDamage = 0.0; hasDamageRadius = true; indirectDamage = 0.55; damageRadius = 6.0; radiusDamageType = $DamageType::Mine; kickBackStrength = 1500; spacing = 6.0; // how close together mines can be proximity = 2.5; // how close causes a detonation (by player/vehicle) armTime = 2200; // 2.2 seconds to arm a mine after it comes to rest maxDepCount = 9; // try to deploy this many times before detonating explosion = "MineExplosion"; underwaterExplosion = "UnderwaterMineExplosion"; velInheritFactor = 0.5; depthTolerance = 10.0; // depth at which it uses underwater explosion baseEmitter = MineSmokeEmitter; grenadeElasticity = 0.15; grenadeFriction = 0.4; armingDelayMS = 2000; muzzleVelocity = 63.7; drag = 0.1; sound = MineProjectileSound; hasLight = true; lightRadius = 4; lightColor = "0.102 0.102 0.102"; hasLightUnderwaterColor = false; }; //-------------------------------------------------------------------------- // Ammo //-------------------------------------- datablock ItemData(MLAmmo) { className = Ammo; catagory = "Ammo"; shapeFile = "ammo_mine.dts"; mass = 2; elasticity = 0.2; friction = 0.7; pickupRadius = 2; pickUpName = "some mine launcher ammo"; computeCRC = true; }; //-------------------------------------------------------------------------- // Weapon //-------------------------------------- datablock ItemData(ML) { className = Weapon; catagory = "Spawn Items"; shapeFile = "weapon_grenade_launcher.dts"; image = MLImage; mass = 1; elasticity = 0.2; friction = 0.6; pickupRadius = 2; pickUpName = "a mine launcher"; computeCRC = true; }; datablock ShapeBaseImageData(MLImage) { className = WeaponImage; shapeFile = "weapon_grenade_launcher.dts"; item = ML; ammo = MLAmmo; offset = "0 0 0"; emap = true; projectile = MLMine; projectileType = GrenadeProjectile; stateName[0] = "Activate"; stateTransitionOnTimeout[0] = "ActivateReady"; stateTimeoutValue[0] = 0.5; stateSequence[0] = "Activate"; stateSound[0] = MineSwitchSound; stateName[1] = "ActivateReady"; stateTransitionOnLoaded[1] = "Ready"; stateTransitionOnNoAmmo[1] = "NoAmmo"; stateName[2] = "Ready"; stateTransitionOnNoAmmo[2] = "NoAmmo"; stateTransitionOnTriggerDown[2] = "Fire"; stateName[3] = "Fire"; stateTransitionOnTimeout[3] = "Reload"; stateTimeoutValue[3] = 0.4; stateFire[3] = true; stateRecoil[3] = LightRecoil; stateAllowImageChange[3] = false; stateSequence[3] = "Fire"; stateScript[3] = "onFire"; stateSound[3] = MineFireSound; stateName[4] = "Reload"; stateTransitionOnNoAmmo[4] = "NoAmmo"; stateTransitionOnTimeout[4] = "Ready"; stateTimeoutValue[4] = 0.5; stateAllowImageChange[4] = false; stateSequence[4] = "Reload"; stateSound[4] = MineReloadSound; stateName[5] = "NoAmmo"; stateTransitionOnAmmo[5] = "Reload"; stateSequence[5] = "NoAmmo"; stateTransitionOnTriggerDown[5] = "DryFire"; stateName[6] = "DryFire"; stateSound[6] = MineDryFireSound; stateTimeoutValue[6] = 1.5; stateTransitionOnTimeout[6] = "NoAmmo"; }; //------------------------- // say wat?! //-------------------------