Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //-----------------------------------------------------------------------------
- // Torque Game Engine
- // Copyright (C) GarageGames.com, Inc.
- //-----------------------------------------------------------------------------
- $MaxHelicopters = 3;
- $HelicopterCount = 0;
- //-----------------------------------------------------------------------------
- datablock SFXDescription(HeliLooping3d)
- {
- volume = 1.0;
- isLooping = true;
- loopCount = 5;
- is3D = true;
- ReferenceDistance = 25.0;
- MaxDistance = 100.0;
- type = $SimAudioType;
- };
- datablock SFXProfile(heliEngineSound)
- {
- filename = "art/shapes/vehicles/iroquis/heli.ogg";
- description = HeliLooping3d;
- preload = true;
- };
- datablock SFXProfile(heliExplosionSound)
- {
- filename = "art/sound/m16/m16_explosion.ogg";
- description = AudioDefault3d;
- preload = true;
- };
- datablock ParticleData(HeliDustParticle)
- {
- textureName = "art/ParticleLibrary/ParticleTextures/smoke";
- dragCoefficient = 2.0;
- gravityCoefficient = 1.0;
- inheritedVelFactor = 0.1;
- constantAcceleration = 0.0;
- lifetimeMS = 1000;
- lifetimeVarianceMS = 0;
- colors[0] = "0.5 0.4 0.3 1.0";
- colors[1] = "0.65 0.55 0.45 0.6";
- sizes[0] = 5.0;
- sizes[1] = 10.0;
- useInvAlpha = true;
- };
- datablock ParticleEmitterData(HeliDustEmittera)
- {
- ejectionPeriodMS = 50;
- periodVarianceMS = 0;
- ejectionVelocity = 6;
- velocityVariance = 3.0;
- ejectionOffset = 1.0;
- thetaMin = 0;
- thetaMax = 180;
- phiReferenceVel = 0;
- phiVariance = 360;
- overrideAdvance = false;
- particles = "HeliDustParticle";
- softnessDistance = 1.0;
- };
- datablock ParticleEmitterData(HeliDustEmitterb)
- {
- ejectionPeriodMS = 50;
- periodVarianceMS = 0;
- ejectionVelocity = 6;
- velocityVariance = 3.0;
- ejectionOffset = 1.0;
- thetaMin = 0;
- thetaMax = 180;
- phiReferenceVel = 0;
- phiVariance = 360;
- overrideAdvance = false;
- particles = "HeliDustParticle";
- softnessDistance = 1.0;
- };
- datablock ParticleEmitterData(HeliDustEmitterc)
- {
- ejectionPeriodMS = 50;
- periodVarianceMS = 0;
- ejectionVelocity = 6;
- velocityVariance = 3.0;
- ejectionOffset = 1.0;
- thetaMin = 0;
- thetaMax = 180;
- phiReferenceVel = 0;
- phiVariance = 360;
- overrideAdvance = false;
- particles = "HeliDustParticle";
- softnessDistance = 1.0;
- };
- datablock ParticleData(LightDamageParticle)
- {
- textureName = "art/ParticleLibrary/ParticleTextures/smoke";
- dragCoefficient = 2.0;
- gravityCoefficient = -0.1;
- inheritedVelFactor = 0.1;
- constantAcceleration = 0.0;
- lifetimeMS = 1000;
- lifetimeVarianceMS = 0;
- colors[0] = "0.46 0.46 0.46 1.0";
- colors[1] = "0.16 0.16 0.16 0.0";
- sizes[0] = 1.50;
- sizes[1] = 3.0;
- };
- datablock ParticleEmitterData(LightDamageEmitter)
- {
- ejectionPeriodMS = 10;
- periodVarianceMS = 0;
- ejectionVelocity = 6;
- velocityVariance = 3.0;
- ejectionOffset = 0.0;
- thetaMin = 5;
- thetaMax = 60;
- phiReferenceVel = 0;
- phiVariance = 360;
- overrideAdvance = false;
- particles = "LightDamageParticle";
- softnessDistance = 1.0;
- };
- datablock ParticleData(HeavyDamageParticle)
- {
- textureName = "art/ParticleLibrary/ParticleTextures/smoke";
- dragCoefficient = 2.0;
- gravityCoefficient = -0.1;
- inheritedVelFactor = 0.1;
- constantAcceleration = 0.0;
- lifetimeMS = 2000;
- lifetimeVarianceMS = 0.5;
- colors[0] = "0.25 0.25 0.16 1.0";
- colors[1] = "0.16 0.16 0.16 0.0";
- sizes[0] = 2.50;
- sizes[1] = 5.0;
- };
- datablock ParticleEmitterData(HeavyDamageEmitter)
- {
- ejectionPeriodMS = 10;
- periodVarianceMS = 0;
- ejectionVelocity = 10;
- velocityVariance = 3.0;
- ejectionOffset = 0.4;
- thetaMin = 5;
- thetaMax = 60;
- phiReferenceVel = 0;
- phiVariance = 360;
- overrideAdvance = false;
- particles = "HeavyDamageParticle";
- softnessDistance = 1.0;
- };
- datablock ParticleData(DefaultHeliExplosionParticle)
- {
- dragCoefficient = 2;
- gravityCoefficient = 0.5;
- inheritedVelFactor = 0.9;
- constantAcceleration = 0.0;
- lifetimeMS = 900;
- lifetimeVarianceMS = 200;
- textureName = "art/ParticleLibrary/ParticleTextures/smoke";
- colors[0] = "0.86 0.36 0.26 1.0";
- colors[1] = "0.70 0.36 0.26 0.5";
- colors[2] = "0.56 0.36 0.26 0.0";
- sizes[0] = 8.5;
- sizes[1] = 11.5;
- sizes[2] = 17.0;
- };
- datablock ParticleEmitterData(DestroyedEmitter)
- {
- ejectionPeriodMS = 50;
- periodVarianceMS = 0;
- ejectionVelocity = 10;
- velocityVariance = 3.0;
- ejectionOffset = 0.4;
- thetaMin = 5;
- thetaMax = 60;
- phiReferenceVel = 0;
- phiVariance = 360;
- overrideAdvance = false;
- particles = "defaultHeliExplosionParticle";
- softnessDistance = 1.0;
- };
- datablock DebrisData(defaultHeliDebri)
- {
- explodeOnMaxBounce = false;
- shapeFile = "art/shapes/vehicles/iroquis/iroquis_debris.dts";
- elasticity = 0.15;
- friction = 0.5;
- lifetime = 30.0;
- lifetimeVariance = 0.0;
- minSpinSpeed = 1;
- maxSpinSpeed = 6;
- numBounces = 3;
- bounceVariance = 1.3;
- staticOnMaxBounce = false;
- gravModifier = 1.0;
- useRadiusMass = true;
- baseRadius = 1;
- velocity = 20.0;
- velocityVariance = 12.0;
- };
- //-----------------------------------------------------------------------------
- // Explosion Debris
- // Debris "spark" explosion
- datablock ParticleData(heliDebrisSpark)
- {
- textureName = "art/ParticleLibrary/ParticleTextures/fire";
- dragCoefficient = 0;
- gravityCoefficient = 0.0;
- windCoefficient = 0;
- inheritedVelFactor = 0.5;
- constantAcceleration = 0.0;
- lifetimeMS = 500;
- lifetimeVarianceMS = 50;
- spinRandomMin = -90.0;
- spinRandomMax = 90.0;
- useInvAlpha = false;
- colors[0] = "0.8 0.2 0 1.0";
- colors[1] = "0.8 0.2 0 1.0";
- colors[2] = "0 0 0 0.0";
- sizes[0] = 0.2;
- sizes[1] = 0.3;
- sizes[2] = 0.1;
- times[0] = 0.0;
- times[1] = 0.5;
- times[2] = 1.0;
- };
- datablock ParticleEmitterData(heliDebrisSparkEmitter)
- {
- ejectionPeriodMS = 20;
- periodVarianceMS = 0;
- ejectionVelocity = 0.5;
- velocityVariance = 0.25;
- ejectionOffset = 0.0;
- thetaMin = 0;
- thetaMax = 90;
- phiReferenceVel = 0;
- phiVariance = 360;
- overrideAdvance = false;
- orientParticles = false;
- lifetimeMS = 300;
- particles = "heliDebrisSpark";
- softnessDistance = 1.0;
- };
- datablock ExplosionData(heliDebrisExplosion)
- {
- emitter[0] = heliDebrisSparkEmitter;
- // Turned off..
- shakeCamera = false;
- impulseRadius = 0;
- lightStartRadius = 0;
- lightEndRadius = 0;
- };
- // Debris smoke trail
- datablock ParticleData(heliDebrisTrail)
- {
- textureName = "art/ParticleLibrary/ParticleTextures/fire";
- dragCoefficient = 1;
- gravityCoefficient = 0;
- inheritedVelFactor = 0;
- windCoefficient = 0;
- constantAcceleration = 0;
- lifetimeMS = 800;
- lifetimeVarianceMS = 100;
- spinSpeed = 0;
- spinRandomMin = -90.0;
- spinRandomMax = 90.0;
- useInvAlpha = true;
- colors[0] = "0.8 0.3 0.0 1.0";
- colors[1] = "0.1 0.1 0.1 0.7";
- colors[2] = "0.1 0.1 0.1 0.0";
- sizes[0] = 0.2;
- sizes[1] = 0.3;
- sizes[2] = 0.4;
- times[0] = 0.1;
- times[1] = 0.2;
- times[2] = 1.0;
- };
- datablock ParticleEmitterData(heliDebrisTrailEmitter)
- {
- ejectionPeriodMS = 30;
- periodVarianceMS = 0;
- ejectionVelocity = 0.0;
- velocityVariance = 0.0;
- ejectionOffset = 0.0;
- thetaMin = 170;
- thetaMax = 180;
- phiReferenceVel = 0;
- phiVariance = 360;
- //overrideAdvance = false;
- //orientParticles = true;
- lifetimeMS = 5000;
- particles = "heliDebrisTrail";
- softnessDistance = 1.0;
- };
- // Debris object
- datablock DebrisData(heliExplosionDebris)
- {
- shapeFile = "art/shapes/vehicles/common/debris.dts";
- emitters = "heliDebrisTrailEmitter";
- explosion = heliDebrisExplosion;
- elasticity = 0.6;
- friction = 0.5;
- numBounces = 1;
- bounceVariance = 1;
- explodeOnMaxBounce = true;
- staticOnMaxBounce = false;
- snapOnMaxBounce = false;
- minSpinSpeed = 0;
- maxSpinSpeed = 700;
- render2D = false;
- lifetime = 4;
- lifetimeVariance = 0.4;
- velocity = 10;
- velocityVariance = 0.5;
- fade = false;
- useRadiusMass = true;
- baseRadius = 0.3;
- gravModifier = 0.9;
- terminalVelocity = 6;
- ignoreWater = true;
- };
- datablock ParticleData(heliExplosionSmoke)
- {
- textureName = "art/ParticleLibrary/ParticleTextures/smoke";
- dragCoeffiecient = 100.0;
- gravityCoefficient = 0;
- inheritedVelFactor = 0.25;
- constantAcceleration = -0.30;
- lifetimeMS = 1200;
- lifetimeVarianceMS = 300;
- useInvAlpha = true;
- spinRandomMin = -80.0;
- spinRandomMax = 80.0;
- colors[0] = "0.56 0.36 0.26 1.0";
- colors[1] = "0.2 0.2 0.2 1.0";
- colors[2] = "0.0 0.0 0.0 0.0";
- sizes[0] = 4.0;
- sizes[1] = 5;
- sizes[2] = 6;
- times[0] = 0.0;
- times[1] = 0.5;
- times[2] = 1.0;
- };
- datablock ParticleEmitterData(heliExplosionSmokeEmitter)
- {
- ejectionPeriodMS = 10;
- periodVarianceMS = 0;
- ejectionVelocity = 4;
- velocityVariance = 0.5;
- thetaMin = 0.0;
- thetaMax = 180.0;
- lifetimeMS = 250;
- particles = "heliExplosionSmoke";
- softnessDistance = 1.0;
- };
- datablock ParticleData(heliExplosionFire)
- {
- textureName = "art/ParticleLibrary/ParticleTextures/fire";
- dragCoeffiecient = 100.0;
- gravityCoefficient = 0;
- inheritedVelFactor = 0.25;
- constantAcceleration = 0.1;
- lifetimeMS = 1200;
- lifetimeVarianceMS = 300;
- useInvAlpha = false;
- spinRandomMin = -80.0;
- spinRandomMax = 80.0;
- colors[0] = "0.8 0.4 0 0.8";
- colors[1] = "0.2 0.0 0 0.8";
- colors[2] = "0.0 0.0 0.0 0.0";
- sizes[0] = 1.5;
- sizes[1] = 3;
- sizes[2] = 5;
- times[0] = 0.0;
- times[1] = 0.5;
- times[2] = 1.0;
- };
- datablock ParticleEmitterData(heliExplosionFireEmitter)
- {
- ejectionPeriodMS = 5;
- periodVarianceMS = 0;
- ejectionVelocity = 0.8;
- velocityVariance = 0.5;
- thetaMin = 0.0;
- thetaMax = 180.0;
- lifetimeMS = 250;
- particles = "heliExplosionFire";
- softnessDistance = 1.0;
- };
- datablock ParticleData(heliExplosionSparks)
- {
- textureName = "art/ParticleLibrary/ParticleTextures/spark";
- dragCoefficient = 1;
- gravityCoefficient = 0.0;
- inheritedVelFactor = 0.2;
- constantAcceleration = 0.0;
- lifetimeMS = 500;
- lifetimeVarianceMS = 350;
- colors[0] = "0.60 0.40 0.30 1.0";
- colors[1] = "0.60 0.40 0.30 1.0";
- colors[2] = "1.0 0.40 0.30 0.0";
- sizes[0] = 0.25;
- sizes[1] = 0.15;
- sizes[2] = 0.15;
- times[0] = 0.0;
- times[1] = 0.5;
- times[2] = 1.0;
- };
- datablock ParticleEmitterData(heliExplosionSparkEmitter)
- {
- ejectionPeriodMS = 3;
- periodVarianceMS = 0;
- ejectionVelocity = 5;
- velocityVariance = 1;
- ejectionOffset = 0.0;
- thetaMin = 0;
- thetaMax = 180;
- phiReferenceVel = 0;
- phiVariance = 360;
- overrideAdvance = false;
- orientParticles = true;
- lifetimeMS = 100;
- particles = "heliExplosionSparks";
- softnessDistance = 1.0;
- };
- datablock ExplosionData(heliSubExplosion1)
- {
- offset = 0;
- emitter[0] = heliExplosionSmokeEmitter;
- emitter[1] = heliExplosionSparkEmitter;
- };
- datablock ExplosionData(heliSubExplosion2)
- {
- offset = 1.0;
- emitter[0] = heliExplosionSmokeEmitter;
- emitter[1] = heliExplosionSparkEmitter;
- };
- datablock ExplosionData(heliExplosion)
- {
- soundProfile = heliExplosionSound;
- lifeTimeMS = 1200;
- // Volume particles
- particleEmitter = heliExplosionFireEmitter;
- particleDensity = 300;
- particleRadius = 8;
- // Point emission
- emitter[0] = heliExplosionSmokeEmitter;
- emitter[1] = heliExplosionSparkEmitter;
- // Sub explosion objects
- subExplosion[0] = heliSubExplosion1;
- subExplosion[1] = heliSubExplosion2;
- // Camera Shaking
- shakeCamera = true;
- camShakeFreq = "10.0 11.0 10.0";
- camShakeAmp = "1.0 1.0 1.0";
- camShakeDuration = 0.5;
- camShakeRadius = 10.0;
- // Exploding debris
- debris = heliExplosionDebris;
- debrisThetaMin = 0;
- debrisThetaMax = 60;
- debrisPhiMin = 0;
- debrisPhiMax = 360;
- debrisNum = 7;
- debrisNumVariance = 5;
- debrisVelocity = 0.8;
- debrisVelocityVariance = 0.4;
- // Impulse
- impulseRadius = 20;
- impulseForce = 40;
- // Dynamic light
- lightStartRadius = 6;
- lightEndRadius = 3;
- lightStartColor = "0.5 0.5 0";
- lightEndColor = "0 0 0";
- };
- datablock ParticleData(HeliGroundDust)
- {
- dragCoefficient = 1.0;
- gravityCoefficient = -0.01;
- inheritedVelFactor = 0.0;
- constantAcceleration = 0.0;
- lifetimeMS = 2500;//2000;
- lifetimeVarianceMS = 500;
- useInvAlpha = true;
- spinRandomMin = -90.0;
- spinRandomMax = 90.0;
- textureName = "art/ParticleLibrary/ParticleTextures/smoke";
- colors[0] = "0.5 0.4 0.3 0.05";
- colors[1] = "0.65 0.55 0.45 0.05";
- colors[2] = "0.60 0.60 0.60 0.05";
- sizes[0] = 3.0;//3;
- sizes[1] = 4.0;//4;
- sizes[2] = 5.0;//5;
- times[0] = 0.0;
- times[1] = 0.7;
- times[2] = 1.0;
- };
- datablock ParticleEmitterData(HeliGroundDustEmitter)
- {
- canSaveDynamicFields = "1";
- Enabled = "1";
- ejectionPeriodMS = "1";
- periodVarianceMS = "0";
- ejectionVelocity = "20";
- velocityVariance = "10";
- ejectionOffset = "0";
- thetaMin = "85";
- thetaMax = "85";
- phiReferenceVel = "0";
- phiVariance = "360";
- softnessDistance = "1";
- ambientFactor = "0";
- overrideAdvance = "1";
- orientParticles = "0";
- orientOnVelocity = "1";
- particles = "HeliGroundDust";
- lifetimeMS = "0";
- lifetimeVarianceMS = "0";
- useEmitterSizes = "0";
- useEmitterColors = "0";
- blendStyle = "NORMAL";
- srcBlendFactor = "SRC_ALPHA";
- dstBlendFactor = "ONE_MINUS_SRC_ALPHA";
- sortParticles = "0";
- reverseOrder = "0";
- alignParticles = "0";
- alignDirection = "0 1 0";
- overrideAdvance = "0";
- };
- //DS ON-MODEL CONTROLS/GUI/HUD
- datablock ShapeBaseImageData(DefaultHeliHud)
- {
- shapeFile = "art/shapes/vehicles/iroquis/heliHud.dts";
- emap = true;
- className = "VehicleWeaponImage";
- mountPoint = 0;
- offset = "0 0.2 0.8";
- //rotation = "1 0 0 -30";
- };
- //DS ON-MODEL CONTROLS/GUI/HUD
- //-----------------------------------------------------------------------------
- datablock HeliVehicleData(DefaultHeli)
- {
- vehicleType = "helicopter";
- category = "Vehicles";
- shapeFile = "art/shapes/vehicles/iroquis/iroquis.dts";
- emap = true;
- //shapeType = $ShapeType::Box;
- //scale = "1 1 1";
- //minContactSpeed = 1.0;
- //slidingThreshold = 0.5;
- //mass = 2;//200
- useEyePoint = true;
- mountable = true;
- maxMountSpeed = 40.0;
- mountDelay = 0;
- dismountDelay = 1;
- stationaryThreshold = 0.5;
- maxDismountSpeed = 0.1;
- numMountPoints = 4;
- actionMapForMountPoint[0] = "heliDriverMap";
- mountPose[0] = "sitting";
- mountPointTransform[0] = "0 0 0 0 0 1 0";
- actionMapForMountPoint[1] = "heliPassengerMap";
- mountPose[1] = "Sitting";
- mountPointTransform[1] = "0 0 0 0 0 1 0";
- // When more mounts are added they will use this map.
- actionMapForMountPoint[2] = "heliPassengerMap";
- mountPose[2] = "Sitting";
- mountPointTransform[2] = "0 0 0 0 0 1 0";
- actionMapForMountPoint[3] = "heliPassengerMap";
- mountPose[3] = "Sitting";
- mountPointTransform[3] = "0 0 0 0 0 1 0";
- shadowSize = "1024";
- mountPose0 = "sitting";
- mountPose1 = "Sitting";
- mountPose2 = "Sitting";
- mountPointTransform0 = "0 0 0 0 0 1 0";
- mountPose3 = "Sitting";
- mountPointTransform1 = "0 0 0 0 0 1 0";
- mountPointTransform2 = "0 0 0 0 0 1 0";
- mountPointTransform3 = "0 0 0 0 0 1 0";
- actionMapForMountPoint1 = "heliPassengerMap";
- actionMapForMountPoint2 = "heliPassengerMap";
- actionMapForMountPoint0 = "heliDriverMap";
- actionMapForMountPoint3 = "heliPassengerMap";
- maxDamage = 750.0;
- destroyedLevel = 750.0;
- // 3rd person camera settings
- cameraRoll = true; // Roll the camera with the vehicle
- cameraMaxDist = 25; // Far distance from vehicle
- cameraOffset = 5; // Vertical offset from camera mount point
- cameraLag = 0.1; // Velocity lag of camera
- cameraDecay = 0.25; // Decay per sec. rate of velocity lag
- isShielded = true;
- maxEnergy = 250; //Afterburner and any energy weapon pool
- rechargeRate = 0;
- minDrag = 500; //Linear Drag (eventually slows you down when not thrusting...constant drag)
- rotationalDrag = 20; //Anguler Drag (dampens the drift after you stop moving the mouse...also tumble drag)
- maxAutoSpeed = 15; //Autostabilizer kicks in when less than this speed. (meters/second)
- autoAngularForce = 20; //Angular stabilizer force (this force levels you out when autostabilizer kicks in) up & down force
- autoLinearForce = 20; //Linear stabilzer force (this slows you down when autostabilizer kicks in)
- autoInputDamping = 0.95; //Dampen control input so you don't` whack out at very slow speeds
- // Maneuvering
- maxSteeringAngle = 3.5; //Max radiens you can rotate the wheel. Smaller number is more maneuverable.//5
- steeringIncrements = 0.9; // Change between 0.1(turn fast) and 0.9(turn slow).
- horizontalSurfaceForce =100; //Horizontal center "wing" (provides "bite" into the wind for climbing/diving & turning)
- verticalSurfaceForce = 100; //Vertical center "wing" (controls side slip. lower numbers make MORE slide.)
- maneuveringForce = 500; //Horizontal jets (W,S,D,A key thrust)
- steeringForce = 2700; //Steering jets (force applied when you move the mouse)
- steeringRollForce = 0.2; //Steering jets (how much you heel over when you turn)
- rollForce = 800; //Auto-roll (self-correction to right you after you roll/invert)
- flyingHeight = 0.1; //Height off the ground at rest
- createflyingHeight = 0.1; // Height off the ground when created
- // Turbo Jet
- jetForce = 8500; //Afterburner thrust (this is in addition to normal thrust)
- minJetEnergy = 0.0; //Afterburner can't be used if below this threshhold.
- jetEnergyDrain = 0.0; //Energy use of the afterburners (low number is less drain...can be fractional)
- vertThrustMultiple = 50; //Higher number means going up and down faster
- // Rigid body
- mass = 200;// //350 300 100 or 70Mass of the vehicle
- bodyFriction = 0; // Don't mess with this.
- bodyRestitution = 0.5; // When you hit the ground, how much you rebound. (between 0 and 1)
- minRollSpeed = 500; // Don't mess with this.
- softImpactSpeed = 0; // 14Sound hooks. This is the soft hit.
- hardImpactSpeed = 10; // 25Sound hooks. This is the hard hit.
- // Ground Impact Damage (uses DamageType::Ground)
- minImpactSpeed = 0.5; //If hit ground at speed above this then it's an impact. Meters/second
- speedDamageScale = 0.06;
- forwardThrust = true;
- gravity = 0; // Gravity of the vehicle
- integration = 16; // Physics integration: TickSec/Rate
- // Object Impact Damage (uses DamageType::Impact)
- collDamageThresholdVel = 20.0;
- collDamageMultiplier = 0.02;
- collisionTol = 5.0; // Collision distance tolerance
- contactTol = 5.0; // Contact velocity tolerance
- // Sounds
- engineSound = HeliEngineSound;
- // Damage Emitters, Offsets, etc.
- damageEmitter[0] = LightDamageEmitter;
- damageEmitter[1] = HeavyDamageEmitter;
- damageEmitter[2] = DestroyedEmitter;
- damageEmitterOffset[0] = "0.0 0.0 0.0";//"0.0 -3.0 0.0"; // right/left forward/backward, up/down
- damageEmitterOffset[1] = "0.0 0.0 0.0";//"0.0 0.0 0.5"; // right/left forward/backward, up/down
- damageEmitterOffset[2] = "0.0 0.0 0.0"; // right/left forward/backward, up/down
- damageLevelTolerance[0] = 0.3;
- damageLevelTolerance[1] = 0.7;
- numDmgEmitterAreas = 1;
- dustEmitter[0] = HeliGroundDustEmitter; //HeliDustEmittera;
- //dustEmitter[1] = HeliGroundDustEmitter; //HeliDustEmitterb;
- //dustEmitter[2] = HeliGroundDustEmitter; //HeliDustEmitterc;
- dustEmitterOffset[0] = "0.0 0.0 0.0 "; // right/left forward/backward, up/down
- //dustEmitterOffset[1] = "0.0 0.0 0.0 "; // right/left forward/backward, up/down
- //dustEmitterOffset[2] = "-50.0 0.0 0.0 "; // right/left forward/backward, up/down
- triggerDustHeight = 4.0;
- dustHeight = 1.0;
- splash = VehicleSplash;
- splashVelocity = 4.0;
- splashAngle = 67.0;
- splashFreqMod = 300.0;
- splashVelEpsilon = 0.60;
- bubbleEmitTime = 0.4;
- splashEmitter[0] = VehicleWakeEmitter;
- splashEmitter[1] = VehicleFoamEmitter;
- splashEmitter[2] = VehicleBubbleEmitter;
- // Explosion
- explosion = heliExplosion;
- debrisShapeName = "art/shapes/vehicles/common/debris.dts";
- debris = defaultHeliDebri;
- maxInv[Chaingun] = 1;
- maxInv[Chaingun2] = 1;
- maxInv[ChaingunAmmo] = 10000;
- maxInv[Chaingun2Ammo] = 10000;
- //maxInv[RocketLauncher] = 1;
- //maxInv[RocketLauncherAmmo] = 1000;
- // Make sure we don't render when
- // we are destroyed
- renderWhenDestroyed = false;
- };
- //-----------------------------------------------------------------------------
- datablock HeliVehicleData(Helicopter)
- {
- spawnOffset = "0 0 2";
- emap = true;
- vehicleType = "helicopter";
- category = "Vehicles";
- shapeFile = "art/shapes/vehicles/iroquis/iroquis.dts";
- multipassenger = false;
- computeCRC = true;
- //shapeName = "art/shapes/vehicles/iroquis/iroquis.dts";
- shapeFile = "art/shapes/vehicles/iroquis/iroquis.dts";
- debris = PlaneExplosionDebris;
- renderWhenDestroyed = false;
- drag = 0.25;
- density = 1.0;
- // Mounting Details
- numMountPoints = 1; // How many mount points you want.
- multipassenger = false; // Depends on # of mountpoints.
- maxMountSpeed = 0.1;
- mountDelay = 8;
- dismountDelay = 1;
- stationaryThreshold = 0.5;
- maxDismountSpeed = 0.1;
- mountPose[0] = "Sitting";
- mountPointTransform[0] = "0 0 0 0 0 1 0";
- isProtectedMountPoint[0] = true;
- isProtectedMountPoint[1] = true;
- minMountDist = 2;
- mountPose[0] = sitting; // This is the possition linked to the animation
- mountable = true;
- // Camera Settings
- cameraOffset = 1.5; // Vertical offset from camera mount point
- cameraMaxDist = 16;
- cameraOffset = 3.65;
- cameraLag = 0.1;
- cameraRoll = true; // Roll the camera with the vehicle
- // Explosions = FighterVehicleExplosion; // Particle Data?
- explosionDamage = 10.5;
- explosionRadius = 15.0;
- maxDamage = 10e20;
- disabledLevel = 0.75;
- destroyedLevel = 1.0;
- // Afterburner and any energy weapon pool
- energyPerDamagePoint = 160;
- maxEnergy = 280;
- rechargeRate = 0.8;
- minDrag = 10; // Linear Drag (eventually slows you down when not thrusting...constant drag)
- rotationalDrag = 20; // Anguler Drag (dampens the drift after you stop moving the mouse...also tumble drag)
- maxAutoSpeed = 1; // Autostabilizer kicks in when less than this speed. (meters/second)
- autoAngularForce = 500; // Angular stabilizer force (this force levels you out when autostabilizer kicks in)
- autoLinearForce = 500; // Linear stabilzer force (this slows you down when autostabilizer kicks in)
- autoInputDamping = 0.55; // Dampen control input so you don't' whack out at very slow speeds
- // Maneuvering
- maxSteeringAngle = 2; // Max radiens you can rotate the wheel. Smaller number is more maneuverable.
- horizontalSurfaceForce = 40; // Horizontal center "wing" (provides "bite" into the wind for climbing/diving and turning)
- verticalSurfaceForce = 20; // Vertical center "wing" (controls side slip. lower numbers make MORE slide.)
- maneuveringForce = 2000; // Horizontal jets (W,S,D,A key thrust) was 3000
- steeringForce = 1000; // Steering jets (force applied when you move the mouse)
- steeringRollForce = 2000; // Steering jets (how much you heel over when you turn)
- rollForce = 20; // Auto-roll (self-correction to right you after you roll/invert)
- hoverHeight = 2; // Height off the ground at rest
- createHoverHeight = 1; // Height off the ground when created
- maxForwardSpeed = 90; // speed in which forward thrust force is no longer applied (meters/second)
- // Turbo Jet
- jetForce = 3000; // Afterburner thrust (this is in addition to normal thrust)
- minJetEnergy = 28; // Afterburner can't be used if below this threshhold.
- jetEnergyDrain = 2.8; // Energy use of the afterburners (low number is less drain...can be fractional) // Auto stabilize speed
- vertThrustMultiple = 3.0;
- // Rigid body
- mass = 100; // Mass of the vehicle
- integration = 3; // Physics integration: TickSec/Rate
- collisionTol = 0.6; // Collision distance tolerance
- contactTol = 0.4; // Contact velocity tolerance
- bodyFriction = 0; // Don't mess with this.
- bodyRestitution = 0.8; // When you hit the ground, how much you rebound. (between 0 and 1)
- minRollSpeed = 2000; // Don't mess with this.
- softImpactSpeed = 3; // Sound hooks. This is the soft hit.
- hardImpactSpeed = 15; // Sound hooks. This is the hard hit.
- // Ground Impact Damage (uses DamageType::Ground)
- minImpactSpeed = 2; // If hit ground at speed above this then it's an impact. Meters/second
- damageMul = 20;
- // Object Impact Damage (uses DamageType::Impact)
- collDamageThresholdVel = 23.0;
- collDamageMultiplier = 0.02;
- // Contrails
- minTrailSpeed = 1500; // The speed your contrail shows up at.
- trailEmitter = FighterContrailEmitter;
- forwardJetEmitter = FighterFJetEmitter;
- downJetEmitter = FighterDJetEmitter;
- checkRadius = 5.5;
- observeParameters = "0 0 1";
- shieldEffectScale = "0.937 1.125 0.60";
- };
- //-----------------------------------------------------------------------------
- function HeliVehicleData::create(%block)
- {
- %obj = new heliVehicle(){
- dataBlock = %block;
- };
- return(%obj);
- }
- function HeliVehicleData::onAdd(%this,%obj)
- {
- Parent::onAdd(%this, %obj);
- %obj.playThread(0,"ambient");
- $HelicopterCount ++;
- %obj.mountable = true;
- %obj.setInventory(Chaingun, 1);
- %obj.setInventory(ChaingunAmmo, 10000);
- %obj.mountImage(ChaingunImage, 0);
- %obj.mountImage(Chaingun2Image, 2);
- %obj.mountImage(DefaultHeliHud, 1); //DS ON-MODEL CONTROLS/GUI/HUD
- //%obj.setInventory(RocketLauncher, 1);
- //%obj.setInventory(RocketLauncherAmmo, 1000);
- //%obj.mountImage(RocketLauncherImage, 1);
- %obj.setEnergyLevel(%this.MaxEnergy);
- %obj.setRechargeRate(%this.rechargeRate);
- }
- function HeliVehicleData::onCollision(%this,%obj,%col,%vec,%speed)
- {
- if (%col.getClassName() $= "Item")
- return;
- %directDamage = 0;
- if ( %speed >= 1 )
- {
- if (%col.getType() & $TypeMasks::ShapeBaseObjectType | $TypeMasks::GameBaseObjectType)
- %col.damage(%obj,%pos,( 3 * %speed ), "heliVehicle");
- %obj.applyImpulse(%pos, VectorScale(%impulseVec, %obj.getDataBlock().mass));
- }
- }
- function heliVehicleData::onDamage(%this,%obj)
- {
- %damageAmt = %obj.getDamageLevel();
- if (%damageAmt >= %this.destroyedLevel)
- {
- // Cloak our main object while
- // our explosion and debris are active
- // make the object unmountable
- %obj.mountable = false;
- %obj.setDamageState(Destroyed);
- }
- }
- function heliVehicleData::damage(%data, %myObj, %sourceObj, %position, %amount, %damageType, %momentum)
- {
- %myObj.applyDamage(%amount);
- // VEHICLE SPARK EFFECT WHEN HIT
- %sparks = new ParticleEmitterNode()
- {
- position = %position;
- rotation = "1 0 0 0";
- scale = "1 1 1";
- dataBlock = "DamageFxNode";
- emitter = "BulletSparks";
- velocity = "1";
- };
- MissionCleanup.add(%sparks);
- }
- function HeliVehicleData::onDestroyed(%data, %obj, %prevState)
- {
- $HelicopterCount --;
- // Loop through all of our mounted objects, and
- // if any are players, unmount them to avoid control
- // object being lost and getting pink screen
- %totalMountedObjects = %obj.getMountedObjectCount();
- // If we don't have anything or anyone mounted then just delete
- // or destroy the vehicle
- if(%totalMountedObjects == 0)
- {
- // Schedule delete for parent afte 3 seconds
- //%obj.schedule(3000, "delete");
- return;
- }
- %driver = %obj.getMountNodeObject(0);
- // Everything by convention that is mounted to the iav should be
- // either a player (an object) or mounted as an image like the cannon,
- // cage, machine gun, plow, etc.
- for(%objCount = %totalMountedObjects; %objCount > -1; %objCount--)
- {
- //get the object at index %objCount
- %mountedObject = %obj.getMountedObject(%objCount);
- // If we have a driver then release so that
- // that client's player is the control object
- // and not the vehicle.
- if(isObject(%driver))
- %driver.client.setControlObject(%driver);
- // set mountVehicle to false
- if (%mountedObject.mVehicle)
- %mountedObject.mountVehicle = false;
- // unmount our object
- %mountedObject.unMount();
- // schedule a time so we can remount shortly
- %mountedObject.schedule(4000, "MountVehicles", true);
- // unhide our player crosshair
- unhideCrossHair();
- // Player ejection
- // Position above dismount point
- %ejectpos = %mountedObject.getPosition();
- %ejectpos = VectorAdd(%ejectpos, "0 0 5");
- %mountedObject.setTransform(%ejectpos);
- // get the vehicles velocity
- %ejectvel = %mountedObject.mVehicle.getVelocity();
- // add this velocity to our hard coded velocity here
- %ejectvel = VectorAdd(%ejectvel, "0 0 10");
- // scale the vector by the mass of the player
- %ejectvel = VectorScale(%ejectvel, %mountedObject.getDataBlock().mass);
- // apply impulse to throw us out of vehicle
- %mountedObject.applyImpulse(%ejectpos, %ejectvel);
- }
- // Schedule delete for parent afte 3 seconds
- %obj.schedule(3000, "delete");
- }
- //-----------------------------------------------------------------------------
- // Weapon Setup
- //-----------------------------------------------------------------------------
- function DefaultHeli::onTrigger(%data, %obj, %trigger, %state)
- {
- // data = datablock
- // obj = object number
- // trigger = 0 for "fire", 1 for "jump", 3 for "thrust"
- // state = 1 for firing, 0 for not firing
- if(%trigger == 0)
- {
- switch (%state) {
- case 0:
- %obj.fireWeapon = false;
- %obj.setImageTrigger(0, false);//false
- %obj.setImageTrigger(2, false);//false
- case 1:
- %obj.fireWeapon = true;
- if(%obj.nextWeaponFire == 2) {
- %obj.setImageTrigger(0, true);
- %obj.setImageTrigger(2, false);//false
- }
- else {
- %obj.setImageTrigger(0, false);
- %obj.setImageTrigger(2, true);//true
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement