SHARE
TWEET

Untitled

a guest Aug 13th, 2017 58 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //-----------------------------------------------------------------------------
  2. // Torque Game Engine
  3. // Copyright (C) GarageGames.com, Inc.
  4. //-----------------------------------------------------------------------------
  5. $MaxHelicopters  = 3;
  6. $HelicopterCount = 0;
  7. //-----------------------------------------------------------------------------
  8. datablock SFXDescription(HeliLooping3d)
  9. {
  10.    volume            = 1.0;
  11.    isLooping         = true;
  12.    loopCount         = 5;
  13.    is3D              = true;
  14.    ReferenceDistance = 25.0;
  15.    MaxDistance       = 100.0;
  16.    type              = $SimAudioType;
  17. };
  18.  
  19. datablock SFXProfile(heliEngineSound)
  20. {
  21.    filename    = "art/shapes/vehicles/iroquis/heli.ogg";
  22.    description = HeliLooping3d;
  23.    preload     = true;
  24. };
  25.  
  26. datablock SFXProfile(heliExplosionSound)
  27. {
  28. filename    = "art/sound/m16/m16_explosion.ogg";
  29. description = AudioDefault3d;
  30. preload     = true;
  31. };
  32.  
  33. datablock ParticleData(HeliDustParticle)
  34. {
  35.    textureName          = "art/ParticleLibrary/ParticleTextures/smoke";
  36.    dragCoefficient      = 2.0;
  37.    gravityCoefficient   = 1.0;
  38.    inheritedVelFactor   = 0.1;
  39.    constantAcceleration = 0.0;
  40.    lifetimeMS           = 1000;
  41.    lifetimeVarianceMS   = 0;
  42.    colors[0]            = "0.5 0.4 0.3 1.0";
  43.    colors[1]            = "0.65 0.55 0.45 0.6";
  44.    sizes[0]             = 5.0;
  45.    sizes[1]             = 10.0;
  46.    useInvAlpha   = true;
  47. };
  48.  
  49. datablock ParticleEmitterData(HeliDustEmittera)
  50. {
  51.    ejectionPeriodMS = 50;
  52.    periodVarianceMS = 0;
  53.    ejectionVelocity = 6;
  54.    velocityVariance = 3.0;
  55.    ejectionOffset   = 1.0;
  56.    thetaMin         = 0;
  57.    thetaMax         = 180;
  58.    phiReferenceVel  = 0;
  59.    phiVariance      = 360;
  60.    overrideAdvance = false;
  61.    particles        = "HeliDustParticle";
  62.    softnessDistance = 1.0;
  63. };
  64. datablock ParticleEmitterData(HeliDustEmitterb)
  65. {
  66.    ejectionPeriodMS = 50;
  67.    periodVarianceMS = 0;
  68.    ejectionVelocity = 6;
  69.    velocityVariance = 3.0;
  70.    ejectionOffset   = 1.0;
  71.    thetaMin         = 0;
  72.    thetaMax         = 180;
  73.    phiReferenceVel  = 0;
  74.    phiVariance      = 360;
  75.    overrideAdvance = false;
  76.    particles        = "HeliDustParticle";
  77.    softnessDistance = 1.0;
  78. };
  79. datablock ParticleEmitterData(HeliDustEmitterc)
  80. {
  81.    ejectionPeriodMS = 50;
  82.    periodVarianceMS = 0;
  83.    ejectionVelocity = 6;
  84.    velocityVariance = 3.0;
  85.    ejectionOffset   = 1.0;
  86.    thetaMin         = 0;
  87.    thetaMax         = 180;
  88.    phiReferenceVel  = 0;
  89.    phiVariance      = 360;
  90.    overrideAdvance = false;
  91.    particles        = "HeliDustParticle";
  92.    softnessDistance = 1.0;
  93. };
  94.  
  95. datablock ParticleData(LightDamageParticle)
  96. {
  97.    textureName          = "art/ParticleLibrary/ParticleTextures/smoke";
  98.    dragCoefficient      = 2.0;
  99.    gravityCoefficient   = -0.1;
  100.    inheritedVelFactor   = 0.1;
  101.    constantAcceleration = 0.0;
  102.    lifetimeMS           = 1000;
  103.    lifetimeVarianceMS   = 0;
  104.    colors[0]            = "0.46 0.46 0.46 1.0";
  105.    colors[1]            = "0.16 0.16 0.16 0.0";
  106.    sizes[0]             = 1.50;
  107.    sizes[1]             = 3.0;
  108. };
  109.  
  110. datablock ParticleEmitterData(LightDamageEmitter)
  111. {
  112.    ejectionPeriodMS = 10;
  113.    periodVarianceMS = 0;
  114.    ejectionVelocity = 6;
  115.    velocityVariance = 3.0;
  116.    ejectionOffset   = 0.0;
  117.    thetaMin         = 5;
  118.    thetaMax         = 60;
  119.    phiReferenceVel  = 0;
  120.    phiVariance      = 360;
  121.    overrideAdvance = false;
  122.    particles        = "LightDamageParticle";
  123.    softnessDistance = 1.0;
  124. };
  125.  
  126. datablock ParticleData(HeavyDamageParticle)
  127. {
  128.    textureName          = "art/ParticleLibrary/ParticleTextures/smoke";
  129.    dragCoefficient      = 2.0;
  130.    gravityCoefficient   = -0.1;
  131.    inheritedVelFactor   = 0.1;
  132.    constantAcceleration = 0.0;
  133.    lifetimeMS           = 2000;
  134.    lifetimeVarianceMS   = 0.5;
  135.    colors[0]            = "0.25 0.25 0.16 1.0";
  136.    colors[1]            = "0.16 0.16 0.16 0.0";
  137.    sizes[0]             = 2.50;
  138.    sizes[1]             = 5.0;
  139. };
  140.  
  141. datablock ParticleEmitterData(HeavyDamageEmitter)
  142. {
  143.    ejectionPeriodMS = 10;
  144.    periodVarianceMS = 0;
  145.    ejectionVelocity = 10;
  146.    velocityVariance = 3.0;
  147.    ejectionOffset   = 0.4;
  148.    thetaMin         = 5;
  149.    thetaMax         = 60;
  150.    phiReferenceVel  = 0;
  151.    phiVariance      = 360;
  152.    overrideAdvance = false;
  153.    particles        = "HeavyDamageParticle";
  154.    softnessDistance = 1.0;
  155. };
  156.  
  157. datablock ParticleData(DefaultHeliExplosionParticle)
  158. {
  159.    dragCoefficient      = 2;
  160.    gravityCoefficient   = 0.5;
  161.    inheritedVelFactor   = 0.9;
  162.    constantAcceleration = 0.0;
  163.    lifetimeMS           = 900;
  164.    lifetimeVarianceMS   = 200;
  165.    textureName          = "art/ParticleLibrary/ParticleTextures/smoke";
  166.    colors[0]            = "0.86 0.36 0.26 1.0";
  167.    colors[1]            = "0.70 0.36 0.26 0.5";
  168.    colors[2]            = "0.56 0.36 0.26 0.0";
  169.    sizes[0]             = 8.5;
  170.    sizes[1]             = 11.5;
  171.    sizes[2]             = 17.0;
  172. };
  173.  
  174. datablock ParticleEmitterData(DestroyedEmitter)
  175. {
  176.    ejectionPeriodMS = 50;
  177.    periodVarianceMS = 0;
  178.    ejectionVelocity = 10;
  179.    velocityVariance = 3.0;
  180.    ejectionOffset   = 0.4;
  181.    thetaMin         = 5;
  182.    thetaMax         = 60;
  183.    phiReferenceVel  = 0;
  184.    phiVariance      = 360;
  185.    overrideAdvance = false;
  186.    particles        = "defaultHeliExplosionParticle";
  187.    softnessDistance = 1.0;
  188. };
  189.  
  190. datablock DebrisData(defaultHeliDebri)
  191. {
  192.    explodeOnMaxBounce = false;
  193.    shapeFile   = "art/shapes/vehicles/iroquis/iroquis_debris.dts";
  194.    elasticity         = 0.15;
  195.    friction           = 0.5;
  196.  
  197.    lifetime           = 30.0;
  198.    lifetimeVariance   = 0.0;
  199.  
  200.    minSpinSpeed       = 1;
  201.    maxSpinSpeed       = 6;
  202.  
  203.    numBounces         = 3;
  204.    bounceVariance     = 1.3;
  205.  
  206.    staticOnMaxBounce  = false;
  207.    gravModifier       = 1.0;
  208.  
  209.    useRadiusMass      = true;
  210.    baseRadius         = 1;
  211.  
  212.    velocity           = 20.0;
  213.    velocityVariance   = 12.0;
  214. };
  215.  
  216. //-----------------------------------------------------------------------------
  217. // Explosion Debris
  218.  
  219. // Debris "spark" explosion
  220. datablock ParticleData(heliDebrisSpark)
  221. {
  222.    textureName          = "art/ParticleLibrary/ParticleTextures/fire";
  223.    dragCoefficient      = 0;
  224.    gravityCoefficient   = 0.0;
  225.    windCoefficient      = 0;
  226.    inheritedVelFactor   = 0.5;
  227.    constantAcceleration = 0.0;
  228.    lifetimeMS           = 500;
  229.    lifetimeVarianceMS   = 50;
  230.    spinRandomMin        = -90.0;
  231.    spinRandomMax        =  90.0;
  232.    useInvAlpha          = false;
  233.  
  234.    colors[0]            = "0.8 0.2 0 1.0";
  235.    colors[1]            = "0.8 0.2 0 1.0";
  236.    colors[2]            = "0 0 0 0.0";
  237.  
  238.    sizes[0]             = 0.2;
  239.    sizes[1]             = 0.3;
  240.    sizes[2]             = 0.1;
  241.  
  242.    times[0]             = 0.0;
  243.    times[1]             = 0.5;
  244.    times[2]             = 1.0;
  245. };
  246.  
  247. datablock ParticleEmitterData(heliDebrisSparkEmitter)
  248. {
  249.    ejectionPeriodMS = 20;
  250.    periodVarianceMS = 0;
  251.    ejectionVelocity = 0.5;
  252.    velocityVariance = 0.25;
  253.    ejectionOffset   = 0.0;
  254.    thetaMin         = 0;
  255.    thetaMax         = 90;
  256.    phiReferenceVel  = 0;
  257.    phiVariance      = 360;
  258.    overrideAdvance = false;
  259.    orientParticles  = false;
  260.    lifetimeMS       = 300;
  261.    particles        = "heliDebrisSpark";
  262.    softnessDistance = 1.0;
  263. };
  264.  
  265. datablock ExplosionData(heliDebrisExplosion)
  266. {
  267.    emitter[0]       = heliDebrisSparkEmitter;
  268.  
  269.    // Turned off..
  270.    shakeCamera      = false;
  271.    impulseRadius    = 0;
  272.    lightStartRadius = 0;
  273.    lightEndRadius   = 0;
  274. };
  275.  
  276. // Debris smoke trail
  277. datablock ParticleData(heliDebrisTrail)
  278. {
  279.    textureName          = "art/ParticleLibrary/ParticleTextures/fire";
  280.    dragCoefficient      = 1;
  281.    gravityCoefficient   = 0;
  282.    inheritedVelFactor   = 0;
  283.    windCoefficient      = 0;
  284.    constantAcceleration = 0;
  285.    lifetimeMS           = 800;
  286.    lifetimeVarianceMS   = 100;
  287.    spinSpeed            = 0;
  288.    spinRandomMin        = -90.0;
  289.    spinRandomMax        =  90.0;
  290.    useInvAlpha          = true;
  291.  
  292.    colors[0]            = "0.8 0.3 0.0 1.0";
  293.    colors[1]            = "0.1 0.1 0.1 0.7";
  294.    colors[2]            = "0.1 0.1 0.1 0.0";
  295.  
  296.    sizes[0]             = 0.2;
  297.    sizes[1]             = 0.3;
  298.    sizes[2]             = 0.4;
  299.  
  300.    times[0]             = 0.1;
  301.    times[1]             = 0.2;
  302.    times[2]             = 1.0;
  303. };
  304.  
  305. datablock ParticleEmitterData(heliDebrisTrailEmitter)
  306. {
  307.    ejectionPeriodMS = 30;
  308.    periodVarianceMS = 0;
  309.    ejectionVelocity = 0.0;
  310.    velocityVariance = 0.0;
  311.    ejectionOffset   = 0.0;
  312.    thetaMin         = 170;
  313.    thetaMax         = 180;
  314.    phiReferenceVel  = 0;
  315.    phiVariance      = 360;
  316.    //overrideAdvance = false;
  317.    //orientParticles  = true;
  318.    lifetimeMS       = 5000;
  319.    particles        = "heliDebrisTrail";
  320.    softnessDistance = 1.0;
  321. };
  322.  
  323. // Debris object
  324. datablock DebrisData(heliExplosionDebris)
  325. {
  326.    shapeFile          = "art/shapes/vehicles/common/debris.dts";
  327.    emitters           = "heliDebrisTrailEmitter";
  328.    explosion          = heliDebrisExplosion;
  329.    
  330.    elasticity         = 0.6;
  331.    friction           = 0.5;
  332.    numBounces         = 1;
  333.    bounceVariance     = 1;
  334.    explodeOnMaxBounce = true;
  335.    staticOnMaxBounce  = false;
  336.    snapOnMaxBounce    = false;
  337.    minSpinSpeed       = 0;
  338.    maxSpinSpeed       = 700;
  339.    render2D           = false;
  340.    lifetime           = 4;
  341.    lifetimeVariance   = 0.4;
  342.    velocity           = 10;
  343.    velocityVariance   = 0.5;
  344.    fade               = false;
  345.    useRadiusMass      = true;
  346.    baseRadius         = 0.3;
  347.    gravModifier       = 0.9;
  348.    terminalVelocity   = 6;
  349.    ignoreWater        = true;
  350. };
  351.  
  352. datablock ParticleData(heliExplosionSmoke)
  353. {
  354.    textureName          = "art/ParticleLibrary/ParticleTextures/smoke";
  355.    dragCoeffiecient     = 100.0;
  356.    gravityCoefficient   = 0;
  357.    inheritedVelFactor   = 0.25;
  358.    constantAcceleration = -0.30;
  359.    lifetimeMS           = 1200;
  360.    lifetimeVarianceMS   = 300;
  361.    useInvAlpha          =  true;
  362.    spinRandomMin        = -80.0;
  363.    spinRandomMax        =  80.0;
  364.  
  365.    colors[0]            = "0.56 0.36 0.26 1.0";
  366.    colors[1]            = "0.2 0.2 0.2 1.0";
  367.    colors[2]            = "0.0 0.0 0.0 0.0";
  368.  
  369.    sizes[0]             = 4.0;
  370.    sizes[1]             = 5;
  371.    sizes[2]             = 6;
  372.  
  373.    times[0]             = 0.0;
  374.    times[1]             = 0.5;
  375.    times[2]             = 1.0;
  376. };
  377.  
  378. datablock ParticleEmitterData(heliExplosionSmokeEmitter)
  379. {
  380.    ejectionPeriodMS = 10;
  381.    periodVarianceMS = 0;
  382.    ejectionVelocity = 4;
  383.    velocityVariance = 0.5;
  384.    thetaMin         = 0.0;
  385.    thetaMax         = 180.0;
  386.    lifetimeMS       = 250;
  387.    particles        = "heliExplosionSmoke";
  388.    softnessDistance = 1.0;
  389. };
  390.  
  391. datablock ParticleData(heliExplosionFire)
  392. {
  393.    textureName          = "art/ParticleLibrary/ParticleTextures/fire";
  394.    dragCoeffiecient     = 100.0;
  395.    gravityCoefficient   = 0;
  396.    inheritedVelFactor   = 0.25;
  397.    constantAcceleration = 0.1;
  398.    lifetimeMS           = 1200;
  399.    lifetimeVarianceMS   = 300;
  400.    useInvAlpha          =  false;
  401.    spinRandomMin        = -80.0;
  402.    spinRandomMax        =  80.0;
  403.  
  404.    colors[0]            = "0.8 0.4 0 0.8";
  405.    colors[1]            = "0.2 0.0 0 0.8";
  406.    colors[2]            = "0.0 0.0 0.0 0.0";
  407.  
  408.    sizes[0]             = 1.5;
  409.    sizes[1]             = 3;
  410.    sizes[2]             = 5;
  411.  
  412.    times[0]             = 0.0;
  413.    times[1]             = 0.5;
  414.    times[2]             = 1.0;
  415. };
  416.  
  417. datablock ParticleEmitterData(heliExplosionFireEmitter)
  418. {
  419.    ejectionPeriodMS = 5;
  420.    periodVarianceMS = 0;
  421.    ejectionVelocity = 0.8;
  422.    velocityVariance = 0.5;
  423.    thetaMin         = 0.0;
  424.    thetaMax         = 180.0;
  425.    lifetimeMS       = 250;
  426.    particles        = "heliExplosionFire";
  427.    softnessDistance = 1.0;
  428. };
  429.  
  430. datablock ParticleData(heliExplosionSparks)
  431. {
  432.    textureName          = "art/ParticleLibrary/ParticleTextures/spark";
  433.    dragCoefficient      = 1;
  434.    gravityCoefficient   = 0.0;
  435.    inheritedVelFactor   = 0.2;
  436.    constantAcceleration = 0.0;
  437.    lifetimeMS           = 500;
  438.    lifetimeVarianceMS   = 350;
  439.  
  440.    colors[0]            = "0.60 0.40 0.30 1.0";
  441.    colors[1]            = "0.60 0.40 0.30 1.0";
  442.    colors[2]            = "1.0 0.40 0.30 0.0";
  443.  
  444.    sizes[0]             = 0.25;
  445.    sizes[1]             = 0.15;
  446.    sizes[2]             = 0.15;
  447.  
  448.    times[0]             = 0.0;
  449.    times[1]             = 0.5;
  450.    times[2]             = 1.0;
  451. };
  452.  
  453. datablock ParticleEmitterData(heliExplosionSparkEmitter)
  454. {
  455.    ejectionPeriodMS = 3;
  456.    periodVarianceMS = 0;
  457.    ejectionVelocity = 5;
  458.    velocityVariance = 1;
  459.    ejectionOffset   = 0.0;
  460.    thetaMin         = 0;
  461.    thetaMax         = 180;
  462.    phiReferenceVel  = 0;
  463.    phiVariance      = 360;
  464.    overrideAdvance = false;
  465.    orientParticles  = true;
  466.    lifetimeMS       = 100;
  467.    particles        = "heliExplosionSparks";
  468.    softnessDistance = 1.0;
  469. };
  470.  
  471. datablock ExplosionData(heliSubExplosion1)
  472. {
  473.    offset     = 0;
  474.    emitter[0] = heliExplosionSmokeEmitter;
  475.    emitter[1] = heliExplosionSparkEmitter;
  476. };
  477.  
  478. datablock ExplosionData(heliSubExplosion2)
  479. {
  480.    offset     = 1.0;
  481.    emitter[0] = heliExplosionSmokeEmitter;
  482.    emitter[1] = heliExplosionSparkEmitter;
  483. };
  484.  
  485. datablock ExplosionData(heliExplosion)
  486. {
  487.    soundProfile           = heliExplosionSound;
  488.    lifeTimeMS             = 1200;
  489.  
  490.    // Volume particles
  491.    particleEmitter        = heliExplosionFireEmitter;
  492.    particleDensity        = 300;
  493.    particleRadius         = 8;
  494.  
  495.    // Point emission
  496.    emitter[0]             = heliExplosionSmokeEmitter;
  497.    emitter[1]             = heliExplosionSparkEmitter;
  498.  
  499.    // Sub explosion objects
  500.    subExplosion[0]        = heliSubExplosion1;
  501.    subExplosion[1]        = heliSubExplosion2;
  502.    
  503.    // Camera Shaking
  504.    shakeCamera            = true;
  505.    camShakeFreq           = "10.0 11.0 10.0";
  506.    camShakeAmp            = "1.0 1.0 1.0";
  507.    camShakeDuration       = 0.5;
  508.    camShakeRadius         = 10.0;
  509.  
  510.    // Exploding debris
  511.    debris = heliExplosionDebris;
  512.    debrisThetaMin         = 0;
  513.    debrisThetaMax         = 60;
  514.    debrisPhiMin           = 0;
  515.    debrisPhiMax           = 360;
  516.    debrisNum              = 7;
  517.    debrisNumVariance      = 5;
  518.    debrisVelocity         = 0.8;
  519.    debrisVelocityVariance = 0.4;
  520.    
  521.    // Impulse
  522.    impulseRadius          = 20;
  523.    impulseForce           = 40;
  524.  
  525.    // Dynamic light
  526.    lightStartRadius       = 6;
  527.    lightEndRadius         = 3;
  528.    lightStartColor        = "0.5 0.5 0";
  529.    lightEndColor          = "0 0 0";
  530. };
  531.  
  532. datablock ParticleData(HeliGroundDust)
  533. {
  534.     dragCoefficient = 1.0;
  535.     gravityCoefficient = -0.01;
  536.     inheritedVelFactor = 0.0;
  537.     constantAcceleration = 0.0;
  538.     lifetimeMS = 2500;//2000;
  539.     lifetimeVarianceMS = 500;
  540.     useInvAlpha = true;
  541.     spinRandomMin = -90.0;
  542.     spinRandomMax = 90.0;
  543.     textureName = "art/ParticleLibrary/ParticleTextures/smoke";
  544.     colors[0] = "0.5 0.4 0.3 0.05";
  545.     colors[1] = "0.65 0.55 0.45 0.05";
  546.     colors[2] = "0.60 0.60 0.60 0.05";
  547.     sizes[0] = 3.0;//3;
  548.     sizes[1] = 4.0;//4;
  549.     sizes[2] = 5.0;//5;
  550.     times[0] = 0.0;
  551.     times[1] = 0.7;
  552.     times[2] = 1.0;
  553. };
  554.  
  555. datablock ParticleEmitterData(HeliGroundDustEmitter)
  556. {
  557.    canSaveDynamicFields = "1";
  558.    Enabled = "1";
  559.    ejectionPeriodMS = "1";
  560.    periodVarianceMS = "0";
  561.    ejectionVelocity = "20";
  562.    velocityVariance = "10";
  563.    ejectionOffset = "0";
  564.    thetaMin = "85";
  565.    thetaMax = "85";
  566.    phiReferenceVel = "0";
  567.    phiVariance = "360";
  568.    softnessDistance = "1";
  569.    ambientFactor = "0";
  570.    overrideAdvance = "1";
  571.    orientParticles = "0";
  572.    orientOnVelocity = "1";
  573.    particles = "HeliGroundDust";
  574.    lifetimeMS = "0";
  575.    lifetimeVarianceMS = "0";
  576.    useEmitterSizes = "0";
  577.    useEmitterColors = "0";
  578.    blendStyle = "NORMAL";
  579.    srcBlendFactor = "SRC_ALPHA";
  580.    dstBlendFactor = "ONE_MINUS_SRC_ALPHA";
  581.    sortParticles = "0";
  582.    reverseOrder = "0";
  583.    alignParticles = "0";
  584.    alignDirection = "0 1 0";
  585.    overrideAdvance = "0";
  586. };
  587.  
  588.  //DS ON-MODEL CONTROLS/GUI/HUD
  589. datablock ShapeBaseImageData(DefaultHeliHud)
  590. {
  591.    shapeFile = "art/shapes/vehicles/iroquis/heliHud.dts";
  592.    emap = true;
  593.    className = "VehicleWeaponImage";
  594.    mountPoint = 0;
  595.    offset = "0 0.2 0.8";
  596.    //rotation = "1 0 0 -30";
  597. };
  598.  //DS ON-MODEL CONTROLS/GUI/HUD
  599.  
  600. //-----------------------------------------------------------------------------
  601. datablock HeliVehicleData(DefaultHeli)
  602. {
  603.    vehicleType = "helicopter";
  604.    category    = "Vehicles";
  605.    shapeFile   = "art/shapes/vehicles/iroquis/iroquis.dts";
  606.    emap        = true;
  607.  
  608.    //shapeType = $ShapeType::Box;
  609.    //scale = "1 1 1";
  610.    //minContactSpeed = 1.0;
  611.    //slidingThreshold = 0.5;
  612.    //mass = 2;//200
  613.  
  614.    useEyePoint = true;
  615.  
  616.    mountable     = true;
  617.    maxMountSpeed = 40.0;
  618.    mountDelay    = 0;
  619.    dismountDelay = 1;
  620.  
  621.    stationaryThreshold = 0.5;
  622.    maxDismountSpeed = 0.1;
  623.  
  624.    numMountPoints      = 4;
  625.  
  626.    actionMapForMountPoint[0] = "heliDriverMap";
  627.    mountPose[0]              = "sitting";
  628.    mountPointTransform[0]    = "0 0 0 0 0 1 0";
  629.  
  630.    actionMapForMountPoint[1] = "heliPassengerMap";
  631.    mountPose[1]              = "Sitting";
  632.    mountPointTransform[1]    = "0 0 0 0 0 1 0";
  633.  
  634.     // When more mounts are added they will use this map.
  635.    actionMapForMountPoint[2] = "heliPassengerMap";
  636.    mountPose[2]              = "Sitting";
  637.    mountPointTransform[2]    = "0 0 0 0 0 1 0";
  638.  
  639.    actionMapForMountPoint[3] = "heliPassengerMap";
  640.    mountPose[3]              = "Sitting";
  641.    mountPointTransform[3]    = "0 0 0 0 0 1 0";
  642.  
  643.    shadowSize = "1024";
  644.    mountPose0 = "sitting";
  645.    mountPose1 = "Sitting";
  646.    mountPose2 = "Sitting";
  647.    mountPointTransform0 = "0 0 0 0 0 1 0";
  648.    mountPose3 = "Sitting";
  649.    mountPointTransform1 = "0 0 0 0 0 1 0";
  650.    mountPointTransform2 = "0 0 0 0 0 1 0";
  651.    mountPointTransform3 = "0 0 0 0 0 1 0";
  652.    actionMapForMountPoint1 = "heliPassengerMap";
  653.    actionMapForMountPoint2 = "heliPassengerMap";
  654.    actionMapForMountPoint0 = "heliDriverMap";
  655.    actionMapForMountPoint3 = "heliPassengerMap";
  656.  
  657.    maxDamage      = 750.0;
  658.    destroyedLevel = 750.0;
  659.  
  660.    // 3rd person camera settings
  661.    cameraRoll = true;           // Roll the camera with the vehicle
  662.    cameraMaxDist = 25;           // Far distance from vehicle
  663.    cameraOffset = 5;             // Vertical offset from camera mount point
  664.    cameraLag = 0.1;              // Velocity lag of camera
  665.    cameraDecay = 0.25;           // Decay per sec. rate of velocity lag
  666.  
  667.    isShielded = true;
  668.  
  669.    maxEnergy = 250;              //Afterburner and any energy weapon pool
  670.    rechargeRate = 0;
  671.  
  672.    minDrag = 500;                //Linear Drag (eventually slows you down when not thrusting...constant drag)
  673.    rotationalDrag = 20;          //Anguler Drag (dampens the drift after you stop moving the mouse...also tumble drag)
  674.  
  675.    maxAutoSpeed = 15;            //Autostabilizer kicks in when less than this speed. (meters/second)
  676.    autoAngularForce = 20;        //Angular stabilizer force (this force levels you out when autostabilizer kicks in) up & down force
  677.    autoLinearForce = 20;         //Linear stabilzer force (this slows you down when autostabilizer kicks in)
  678.    autoInputDamping = 0.95;      //Dampen control input so you don't` whack out at very slow speeds
  679.    
  680.    // Maneuvering
  681.    maxSteeringAngle = 3.5;       //Max radiens you can rotate the wheel. Smaller number is more maneuverable.//5
  682.  
  683.    steeringIncrements = 0.9;  // Change between 0.1(turn fast) and 0.9(turn slow).
  684.  
  685.    horizontalSurfaceForce =100;  //Horizontal center "wing" (provides "bite" into the wind for climbing/diving & turning)
  686.    verticalSurfaceForce = 100;   //Vertical center "wing" (controls side slip. lower numbers make MORE slide.)
  687.    maneuveringForce = 500;       //Horizontal jets (W,S,D,A key thrust)
  688.    steeringForce = 2700;         //Steering jets (force applied when you move the mouse)
  689.    steeringRollForce = 0.2;      //Steering jets (how much you heel over when you turn)
  690.    rollForce = 800;              //Auto-roll (self-correction to right you after you roll/invert)
  691.    flyingHeight = 0.1;             //Height off the ground at rest
  692.    createflyingHeight = 0.1;       // Height off the ground when created
  693.  
  694.    // Turbo Jet
  695.    jetForce = 8500;              //Afterburner thrust (this is in addition to normal thrust)
  696.    minJetEnergy = 0.0;           //Afterburner can't be used if below this threshhold.
  697.    jetEnergyDrain = 0.0;         //Energy use of the afterburners (low number is less drain...can be fractional)
  698.    vertThrustMultiple = 50;      //Higher number means going up and down faster
  699.  
  700.    // Rigid body
  701.    mass = 200;//        //350 300 100 or 70Mass of the vehicle
  702.    bodyFriction = 0;     // Don't mess with this.
  703.    bodyRestitution = 0.5;   // When you hit the ground, how much you rebound. (between 0 and 1)
  704.    minRollSpeed = 500;     // Don't mess with this.
  705.    softImpactSpeed = 0;       // 14Sound hooks. This is the soft hit.
  706.    hardImpactSpeed = 10;    // 25Sound hooks. This is the hard hit.
  707.  
  708.    // Ground Impact Damage (uses DamageType::Ground)
  709.    minImpactSpeed = 0.5;         //If hit ground at speed above this then it's an impact. Meters/second
  710.    speedDamageScale = 0.06;
  711.  
  712.    forwardThrust = true;
  713.    gravity = 0; // Gravity of the vehicle
  714.    integration = 16; // Physics integration: TickSec/Rate
  715.  
  716.    // Object Impact Damage (uses DamageType::Impact)
  717.    collDamageThresholdVel = 20.0;
  718.    collDamageMultiplier   = 0.02;
  719.    collisionTol = 5.0;           // Collision distance tolerance
  720.    contactTol = 5.0;             // Contact velocity tolerance
  721.  
  722.    // Sounds
  723.    engineSound             = HeliEngineSound;
  724.  
  725.     // Damage Emitters, Offsets, etc.
  726.    damageEmitter[0]        = LightDamageEmitter;
  727.    damageEmitter[1]        = HeavyDamageEmitter;
  728.    damageEmitter[2]        = DestroyedEmitter;
  729.    damageEmitterOffset[0]  = "0.0 0.0 0.0";//"0.0 -3.0 0.0";   // right/left forward/backward, up/down
  730.    damageEmitterOffset[1]  = "0.0 0.0 0.0";//"0.0 0.0 0.5";   // right/left forward/backward, up/down
  731.    damageEmitterOffset[2]  = "0.0 0.0 0.0";   // right/left forward/backward, up/down
  732.  
  733.    damageLevelTolerance[0] = 0.3;
  734.    damageLevelTolerance[1] = 0.7;
  735.    numDmgEmitterAreas      = 1;
  736.  
  737.    dustEmitter[0]          = HeliGroundDustEmitter; //HeliDustEmittera;
  738.    //dustEmitter[1]          = HeliGroundDustEmitter; //HeliDustEmitterb;
  739.    //dustEmitter[2]          = HeliGroundDustEmitter; //HeliDustEmitterc;
  740.    dustEmitterOffset[0]    = "0.0 0.0 0.0 ";   // right/left forward/backward, up/down
  741.    //dustEmitterOffset[1]    = "0.0 0.0 0.0 ";   // right/left forward/backward, up/down
  742.    //dustEmitterOffset[2]    = "-50.0 0.0 0.0 ";   // right/left forward/backward, up/down
  743.  
  744.    triggerDustHeight = 4.0;
  745.    dustHeight = 1.0;
  746.  
  747.    splash = VehicleSplash;
  748.    splashVelocity = 4.0;
  749.    splashAngle = 67.0;
  750.    splashFreqMod = 300.0;
  751.    splashVelEpsilon = 0.60;
  752.    bubbleEmitTime = 0.4;
  753.    splashEmitter[0] = VehicleWakeEmitter;
  754.    splashEmitter[1] = VehicleFoamEmitter;
  755.    splashEmitter[2] = VehicleBubbleEmitter;
  756.  
  757.    // Explosion
  758.    explosion       = heliExplosion;
  759.    debrisShapeName = "art/shapes/vehicles/common/debris.dts";
  760.    debris          = defaultHeliDebri;
  761.  
  762.    maxInv[Chaingun]           = 1;
  763.    maxInv[Chaingun2]          = 1;
  764.    maxInv[ChaingunAmmo]       = 10000;
  765.    maxInv[Chaingun2Ammo]      = 10000;
  766.    //maxInv[RocketLauncher]     = 1;
  767.    //maxInv[RocketLauncherAmmo] = 1000;
  768.  
  769.     // Make sure we don't render when
  770.     // we are destroyed
  771.     renderWhenDestroyed = false;
  772.  
  773. };
  774.  
  775. //-----------------------------------------------------------------------------
  776. datablock HeliVehicleData(Helicopter)
  777. {
  778.    spawnOffset = "0 0 2";
  779.    emap = true;
  780.    vehicleType = "helicopter";
  781.    category = "Vehicles";
  782.    shapeFile   = "art/shapes/vehicles/iroquis/iroquis.dts";
  783.    multipassenger = false;
  784.    computeCRC = true;
  785.  
  786.    //shapeName   = "art/shapes/vehicles/iroquis/iroquis.dts";
  787.    shapeFile   = "art/shapes/vehicles/iroquis/iroquis.dts";
  788.  
  789. debris = PlaneExplosionDebris;
  790. renderWhenDestroyed = false;
  791.  
  792. drag = 0.25;
  793. density = 1.0;
  794.  
  795. // Mounting Details
  796. numMountPoints = 1; // How many mount points you want.
  797. multipassenger = false; // Depends on # of mountpoints.
  798. maxMountSpeed = 0.1;
  799. mountDelay = 8;
  800. dismountDelay = 1;
  801. stationaryThreshold = 0.5;
  802. maxDismountSpeed = 0.1;
  803. mountPose[0] = "Sitting";
  804. mountPointTransform[0] = "0 0 0 0 0 1 0";
  805. isProtectedMountPoint[0] = true;
  806. isProtectedMountPoint[1] = true;
  807. minMountDist = 2;
  808.  
  809. mountPose[0] = sitting; // This is the possition linked to the animation
  810.  
  811. mountable = true;
  812.  
  813. // Camera Settings
  814. cameraOffset = 1.5; // Vertical offset from camera mount point
  815. cameraMaxDist = 16;
  816. cameraOffset = 3.65;
  817. cameraLag = 0.1;
  818. cameraRoll = true; // Roll the camera with the vehicle
  819.  
  820. // Explosions = FighterVehicleExplosion; // Particle Data?
  821. explosionDamage = 10.5;
  822. explosionRadius = 15.0;
  823.  
  824. maxDamage = 10e20;
  825. disabledLevel = 0.75;
  826. destroyedLevel = 1.0;
  827.  
  828. // Afterburner and any energy weapon pool
  829. energyPerDamagePoint = 160;
  830. maxEnergy = 280;
  831. rechargeRate = 0.8;
  832.  
  833. minDrag = 10; // Linear Drag (eventually slows you down when not thrusting...constant drag)
  834. rotationalDrag = 20; // Anguler Drag (dampens the drift after you stop moving the mouse...also tumble drag)
  835.  
  836. maxAutoSpeed = 1; // Autostabilizer kicks in when less than this speed. (meters/second)
  837. autoAngularForce = 500; // Angular stabilizer force (this force levels you out when autostabilizer kicks in)
  838. autoLinearForce = 500; // Linear stabilzer force (this slows you down when autostabilizer kicks in)
  839. autoInputDamping = 0.55; // Dampen control input so you don't' whack out at very slow speeds
  840.  
  841. // Maneuvering
  842. maxSteeringAngle = 2; // Max radiens you can rotate the wheel. Smaller number is more maneuverable.
  843. horizontalSurfaceForce = 40; // Horizontal center "wing" (provides "bite" into the wind for climbing/diving and turning)
  844. verticalSurfaceForce = 20; // Vertical center "wing" (controls side slip. lower numbers make MORE slide.)
  845. maneuveringForce = 2000; // Horizontal jets (W,S,D,A key thrust) was 3000
  846. steeringForce = 1000; // Steering jets (force applied when you move the mouse)
  847. steeringRollForce = 2000; // Steering jets (how much you heel over when you turn)
  848. rollForce = 20; // Auto-roll (self-correction to right you after you roll/invert)
  849. hoverHeight = 2; // Height off the ground at rest
  850. createHoverHeight = 1; // Height off the ground when created
  851. maxForwardSpeed = 90; // speed in which forward thrust force is no longer applied (meters/second)
  852.  
  853. // Turbo Jet
  854. jetForce = 3000; // Afterburner thrust (this is in addition to normal thrust)
  855. minJetEnergy = 28; // Afterburner can't be used if below this threshhold.
  856. jetEnergyDrain = 2.8; // Energy use of the afterburners (low number is less drain...can be fractional) // Auto stabilize speed
  857. vertThrustMultiple = 3.0;
  858.  
  859. // Rigid body
  860. mass = 100; // Mass of the vehicle
  861. integration = 3; // Physics integration: TickSec/Rate
  862. collisionTol = 0.6; // Collision distance tolerance
  863. contactTol = 0.4; // Contact velocity tolerance
  864.  
  865. bodyFriction = 0; // Don't mess with this.
  866. bodyRestitution = 0.8; // When you hit the ground, how much you rebound. (between 0 and 1)
  867. minRollSpeed = 2000; // Don't mess with this.
  868. softImpactSpeed = 3; // Sound hooks. This is the soft hit.
  869. hardImpactSpeed = 15; // Sound hooks. This is the hard hit.
  870.  
  871. // Ground Impact Damage (uses DamageType::Ground)
  872. minImpactSpeed = 2; // If hit ground at speed above this then it's an impact. Meters/second
  873. damageMul = 20;
  874.  
  875. // Object Impact Damage (uses DamageType::Impact)
  876. collDamageThresholdVel = 23.0;
  877. collDamageMultiplier = 0.02;
  878.  
  879. // Contrails
  880. minTrailSpeed = 1500; // The speed your contrail shows up at.
  881. trailEmitter = FighterContrailEmitter;
  882. forwardJetEmitter = FighterFJetEmitter;
  883. downJetEmitter = FighterDJetEmitter;
  884.  
  885. checkRadius = 5.5;
  886. observeParameters = "0 0 1";
  887. shieldEffectScale = "0.937 1.125 0.60";
  888. };
  889.  
  890. //-----------------------------------------------------------------------------
  891. function HeliVehicleData::create(%block)
  892. {
  893.    %obj = new heliVehicle(){
  894.       dataBlock = %block;
  895.    };
  896.  
  897.    return(%obj);
  898. }
  899.  
  900. function HeliVehicleData::onAdd(%this,%obj)
  901. {
  902.     Parent::onAdd(%this, %obj);
  903.  
  904.    %obj.playThread(0,"ambient");
  905.    $HelicopterCount ++;
  906.  
  907.    %obj.mountable = true;
  908.  
  909.    %obj.setInventory(Chaingun, 1);
  910.    %obj.setInventory(ChaingunAmmo, 10000);
  911.    %obj.mountImage(ChaingunImage, 0);
  912.    %obj.mountImage(Chaingun2Image, 2);
  913.  
  914.    %obj.mountImage(DefaultHeliHud, 1); //DS ON-MODEL CONTROLS/GUI/HUD
  915.  
  916.    //%obj.setInventory(RocketLauncher, 1);
  917.    //%obj.setInventory(RocketLauncherAmmo, 1000);
  918.    //%obj.mountImage(RocketLauncherImage, 1);
  919.  
  920.    %obj.setEnergyLevel(%this.MaxEnergy);
  921.    %obj.setRechargeRate(%this.rechargeRate);
  922. }
  923.  
  924. function HeliVehicleData::onCollision(%this,%obj,%col,%vec,%speed)
  925. {
  926.    if (%col.getClassName() $= "Item")
  927.    return;
  928.  
  929.       %directDamage = 0;
  930.    if ( %speed >= 1 )  
  931.     {  
  932.       if (%col.getType() & $TypeMasks::ShapeBaseObjectType | $TypeMasks::GameBaseObjectType)  
  933.       %col.damage(%obj,%pos,( 3 * %speed ), "heliVehicle");
  934.       %obj.applyImpulse(%pos, VectorScale(%impulseVec, %obj.getDataBlock().mass));
  935.     }
  936. }
  937.  
  938. function heliVehicleData::onDamage(%this,%obj)
  939. {
  940.    %damageAmt = %obj.getDamageLevel();
  941.  
  942.    if (%damageAmt >= %this.destroyedLevel)
  943.    {
  944.       // Cloak our main object while
  945.       // our explosion and debris are active
  946.       // make the object unmountable
  947.       %obj.mountable = false;
  948.       %obj.setDamageState(Destroyed);
  949.    }
  950. }
  951.  
  952. function heliVehicleData::damage(%data, %myObj, %sourceObj, %position, %amount, %damageType, %momentum)
  953. {
  954.    %myObj.applyDamage(%amount);
  955.  
  956.     // VEHICLE SPARK EFFECT WHEN HIT
  957.     %sparks = new ParticleEmitterNode()
  958.     {
  959.         position = %position;
  960.         rotation = "1 0 0 0";
  961.         scale = "1 1 1";
  962.         dataBlock = "DamageFxNode";
  963.         emitter = "BulletSparks";
  964.         velocity = "1";
  965.     };
  966.     MissionCleanup.add(%sparks);
  967. }
  968.  
  969. function HeliVehicleData::onDestroyed(%data, %obj, %prevState)
  970. {
  971.   $HelicopterCount --;
  972.    // Loop through all of our mounted objects, and
  973.    // if any are players, unmount them to avoid control
  974.    // object being lost and getting pink screen
  975.    %totalMountedObjects = %obj.getMountedObjectCount();
  976.  
  977.    // If we don't have anything or anyone mounted then just delete
  978.    // or destroy the vehicle
  979.    if(%totalMountedObjects == 0)
  980.    {
  981.       // Schedule delete for parent afte 3 seconds
  982.      //%obj.schedule(3000, "delete");
  983.       return;
  984.    }
  985.  
  986.    %driver = %obj.getMountNodeObject(0);
  987.  
  988.    // Everything by convention that is mounted to the iav should be
  989.    // either a player (an object) or mounted as an image like the cannon,
  990.    // cage, machine gun, plow, etc.
  991.    for(%objCount = %totalMountedObjects; %objCount > -1; %objCount--)
  992.    {       
  993.         //get the object at index %objCount
  994.         %mountedObject = %obj.getMountedObject(%objCount);
  995.  
  996.         // If we have a driver then release so that
  997.         // that client's player is the control object
  998.         // and not the vehicle.
  999.         if(isObject(%driver))
  1000.             %driver.client.setControlObject(%driver);
  1001.  
  1002.         // set mountVehicle to false
  1003.         if (%mountedObject.mVehicle)
  1004.             %mountedObject.mountVehicle = false;
  1005.  
  1006.         // unmount our object
  1007.         %mountedObject.unMount();
  1008.         // schedule a time so we can remount shortly
  1009.         %mountedObject.schedule(4000, "MountVehicles", true);
  1010.         // unhide our player crosshair
  1011.         unhideCrossHair();
  1012.  
  1013.         // Player ejection
  1014.         // Position above dismount point
  1015.         %ejectpos = %mountedObject.getPosition();
  1016.         %ejectpos = VectorAdd(%ejectpos, "0 0 5");
  1017.         %mountedObject.setTransform(%ejectpos);
  1018.  
  1019.         // get the vehicles velocity
  1020.         %ejectvel = %mountedObject.mVehicle.getVelocity();
  1021.         // add this velocity to our hard coded velocity here
  1022.         %ejectvel = VectorAdd(%ejectvel, "0 0 10");
  1023.         // scale the vector by the mass of the player
  1024.         %ejectvel = VectorScale(%ejectvel, %mountedObject.getDataBlock().mass);
  1025.         // apply impulse to throw us out of vehicle
  1026.         %mountedObject.applyImpulse(%ejectpos, %ejectvel);
  1027.  
  1028.    }
  1029.  
  1030.    // Schedule delete for parent afte 3 seconds
  1031.    %obj.schedule(3000, "delete");
  1032. }
  1033.  
  1034. //-----------------------------------------------------------------------------
  1035. // Weapon Setup
  1036. //-----------------------------------------------------------------------------
  1037. function DefaultHeli::onTrigger(%data, %obj, %trigger, %state)
  1038. {
  1039.    // data = datablock
  1040.    // obj = object number
  1041.    // trigger = 0 for "fire", 1 for "jump", 3 for "thrust"
  1042.    // state = 1 for firing, 0 for not firing
  1043.    if(%trigger == 0)
  1044.    {
  1045.       switch (%state) {
  1046.          case 0:
  1047.             %obj.fireWeapon = false;
  1048.             %obj.setImageTrigger(0, false);//false
  1049.             %obj.setImageTrigger(2, false);//false
  1050.          case 1:
  1051.             %obj.fireWeapon = true;
  1052.             if(%obj.nextWeaponFire == 2) {
  1053.                %obj.setImageTrigger(0, true);
  1054.                %obj.setImageTrigger(2, false);//false
  1055.             }
  1056.             else {
  1057.                %obj.setImageTrigger(0, false);
  1058.                %obj.setImageTrigger(2, true);//true
  1059.             }
  1060.       }
  1061.    }
  1062. }
RAW Paste Data
Pastebin PRO Summer Special!
Get 40% OFF on Pastebin PRO accounts!
Top