Author Topic: Help with vehicle  (Read 1169 times)

Im working on a CH-47 chinook and when I try to spawn it blockland crashes! I don't know if its a problem with the model or the script...

Download Model

If you can make this model into a working vehicle then you can post it on the RTB or BL forums. JUST GIMMI CREDIT FOR THE MODEL PLEASE

I should note that this is my first vehicle. I have worked very hard on the model and I would really like to see it as part of an addon. The "Download Model" link is the finished version of the model with animations.



Code: [Select]
datablock AudioDescription(ch47ChinookLooping3d)
{
   volume   = 4.0;
   isLooping= true;

   is3D     = true;
   ReferenceDistance= 5.5;
   MaxDistance= 80.0;
   type     = $SimAudioType;
};
datablock AudioProfile(ch47ChinookSound)
{
   filename    = "./heli.wav";
   description = ch47ChinookLooping3d;
   preload = true;
};



datablock DebrisData(ch47ChinookDebris)
{
   emitters = "jeepDebrisTrailEmitter";

shapeFile = "./ch47Model.dts";
lifetime = 3.0;
minSpinSpeed = -300.0;
maxSpinSpeed = 300.0;
elasticity = 0.5;
friction = 0.2;
numBounces = 1;
staticOnMaxBounce = true;
snapOnMaxBounce = false;
fade = true;

gravModifier = 2;
};
datablock ExplosionData(ch47ChinookFinalExplosion)
{
   //explosionShape = "";
   lifeTimeMS = 150;

   soundProfile = vehicleExplosionSound;
  
   emitter[0] = vehicleFinalExplosionEmitter3;
   emitter[1] = vehicleFinalExplosionEmitter2;

   particleEmitter = vehicleFinalExplosionEmitter;
   particleDensity = 20;
   particleRadius = 1.0;

   debris = ch47ChinookDebris;
   debrisNum = 1;
   debrisNumVariance = 0;
   debrisPhiMin = 0;
   debrisPhiMax = 360;
   debrisThetaMin = 0;
   debrisThetaMax = 50;
   debrisVelocity = 15;
   debrisVelocityVariance = 3;

   faceViewer     = true;
   explosionScale = "1 1 1";

   shakeCamera = true;
   camShakeFreq = "7.0 8.0 7.0";
   camShakeAmp = "10.0 10.0 10.0";
   camShakeDuration = 0.75;
   camShakeRadius = 15.0;

   // Dynamic light
   lightStartRadius = 0;
   lightEndRadius = 20;
   lightStartColor = "0.45 0.3 0.1";
   lightEndColor = "0 0 0";

   //impulse
   impulseRadius = 15;
   impulseForce = 1000;
   impulseVertical = 2000;

   //radius damage
   radiusDamage        = 30;
   damageRadius        = 8.0;

   //burn the players?
   playerBurnTime = 5000;

};

datablock ProjectileData(ch47ChinookFinalExplosionProjectile)
{
   directDamage        = 0;
   radiusDamage        = 0;
   damageRadius        = 0;
   explosion           = ch47ChinookFinalExplosion;

   directDamageType  = $DamageType::jeepExplosion;
   radiusDamageType  = $DamageType::jeepExplosion;

   explodeOnDeath = 1;

   armingDelay         = 0;
   lifetime            = 10;
};

datablock FlyingVehicleData(ch47ChinookVehicle)
{
   //Tagged fields for mission editor
      category = "Vehicles";
      displayName = " ";

   //Shapebase Fields
      shapeFile   = "./ch47Model.dts";  
      emap        = true;
      mass        = 200;
      drag        = 1.7;
      density     = 4;
      
      maxDamage = 200.00;
      destroyedLevel = 200.00;
      energyPerDamagePoint = 160;
      speedDamageScale = 1.04;
      collDamageThresholdVel = 20.0;
      collDamageMultiplier   = 0.02;





   //Tagged fields for mounting
      minMountDist = 3;  
      numMountPoints = 2;
      mountThread[0] = "sit";
      mountThread[1] = "sit";



lookUpLimit = 0.5;
lookDownLimit = 0.5;

   //Vehicle Fields:
      jetForce          = 500;
      jetEnergyDrain    = 8;
      minJetEnergy      = 1;

      massCenter        = "0 0 0";
      //massBox           = "1 1 1";
      bodyRestitution   = 0.5;
      bodyFriction      = 0.5;
      //softImpactSound   = ; //AudioProfile
      //hardImpactSound   = ; //AudioProfile

      minImpactSpeed    = 25;
      softImpactSpeed   = 25;
      hardImpactSpeed   = 50;
      minRollSpeed      = 0;
      maxSteeringAngle  = 0.785;

      maxDrag        = 40;
      minDrag        = 50;
      integration    = 4;
      collisionTol   = 0.1;
      contactTol     = 0.1;

      cameraRoll     = false;
      cameraMaxDist  = 25;        
      cameraLag      = 0.0;
      cameraDecay    = 0.0;
      cameraOffset   = 5.5;
      cameraTilt     = 0.0;

      //dustEmitter       = ; //ParticleEmitterData
      triggerDustHeight = 3.0;
      dustHeight        = 1.0;

      numDmgEmitterAreas   = 0;
      
      damageEmitter[0] = vehicleBurnEmitter;
      damageEmitterOffset[0] = "0.0 0.0 0.0 ";
      damageLevelTolerance[0] = 0.99;

      damageEmitter[1] = vehicleBurnEmitter;
      damageEmitterOffset[1] = "0.0 0.0 0.0 ";
      damageLevelTolerance[1] = 1.0;

      //splashEmitter[0]        = ; //ParticleEmitterData

      splashFreqMod     = 300.0;
      splashVelEpsilon  = 0.50;

      exitSplashSoundVelocity    = 2.0;
      softSplashSoundVelocity    = 1.0;
      mediumSplashSoundVelocity  = 2.0;
      hardSplashSoundVelocity    = 3.0;

      collDamageThresholdVel  = 20;
      collDamageMultiplier    = 0.05;

   //For Wrench Gui
      uiName   = "CH-47 Chinook";
      rideAble = true;
      paintable = true;

   //Flying vehicle fields
      //jetSound = ;      //AudioProfile
      //engineSound = ;   //AudioProfile

maneuveringForce = 3000; // Horizontal jets (W,S,D,A key thrust)
horizontalSurfaceForce = 10; // Horizontal center "wing" (provides "bite" into the wind for climbing/diving and turning)
verticalSurfaceForce = 100; // Vertical center "wing" (controls side slip. lower numbers make MORE slide.)
autoInputDamping = 0.95; // Dampen control input so you don't` whack out at very slow speeds
steeringForce = 1000; // Steering jets (force applied when you move the mouse)
steeringRollForce = -20; // Steering jets (how much you heel over when you turn) 5
rollForce = 1; // Auto-roll (self-correction to right you after you roll/invert)
autoAngularForce = 1000; // Angular stabilizer force (this force levels you out when autostabilizer kicks in)
rotationalDrag = 8; // Anguler Drag (dampens the drift after you stop moving the mouse...also tumble drag)
autoLinearForce = 100; // Linear stabilzer force (this slows you down when autostabilizer kicks in)
maxAutoSpeed = 15; // Autostabilizer kicks in when less than this speed. (meters/second)
hoverHeight = 1.1; // Height off the ground at rest
createHoverHeight = 0.7; // Height off the ground when created //exec("add-ons/vehicle_U1.cs");

      //forwardJetEmitter    = ; //ParticleEmitterData
      //backwardJetEmitter   = ; //ParticleEmitterData
      //downJetEmitter       = ; //ParticleEmitterData
      //trailEmitter         = ; //ParticleEmitterData

      minTrailSpeed        = 1;
      vertThrustMultiple   = 1.0;

  
   //Tagged fields for damage
      initialExplosionProjectile = ch47ChinookExplosionProjectile;
      initialExplosionOffset = 0;         //offset only uses a z value for now

      burnTime = 500;

      finalExplosionProjectile = ch47ChinookFinalExplosionProjectile;
      finalExplosionOffset = 0.5;          //offset only uses a z value for now

      minRunOverSpeed    = 5;   //how fast you need to be going to run someone over (do damage)
      runOverDamageScale = 5;   //when you run over someone, speed * runoverdamagescale = damage amt
      runOverPushScale   = 1.2; //how hard a person you're running over gets pushed
};


function ch47Chinookvehicle::onadd(%this,%obj)
{
parent::onadd(%this,%obj);
  %obj.playThread(0,"spin");
    %obj.PlayAudio(0,ch47ChinookSound);


}



Flames: I used the script for the UH-60 Blackhawk; so credtis to stratofortress


-WIP
« Last Edit: July 28, 2010, 07:12:37 PM by Plasticman »


Most likely model issue. Did you setup the Heiarchy?

Is there a Collision box?



i originally had mah console log but i got rid of it
« Last Edit: July 17, 2010, 04:53:19 PM by Plasticman »

Its in the collision file probably, (Remove the original one if existing) and just make a cube and call it Col-1


Do you see any meshes/faces before it crashes? Usually when its the collision box you will catch a glimpse of the model before it actually crashes. By heiarchy I meant the whole Shape-->LOD-->model process. I dont know how it works for Milkshape, I use blender, so I used the official term for it.

no, the game "stops responding" as soon as i click send to spawn the vehicle...
« Last Edit: July 19, 2010, 10:53:10 PM by Plasticman »


I had this problem With my Roller Coaster and Innertube Models On Milkshape. It turns out I messed up in Flatshading.