Author Topic: Vehicle Script  (Read 372 times)

Hello,

i made a sample plane and try to figure out what in the vehicle script does what:

My first question:
How do i set the speed? (wich value determines the speed)
Wich value determins the rotation?


My guesses its somewhere there:
Code: [Select]
     maneuveringForce        = 70000;
      horizontalSurfaceForce  = 100;
      verticalSurfaceForce    = 100;
      autoInputDamping        = 0.1;
      steeringForce           = 0; //this is left/right
      steeringRollForce       = 0;
      rollForce               = 0;
      autoAngularForce        = 10;
      rotationalDrag          = 1;
      autoLinearForce         = 1;
      maxAutoSpeed            = 10;
      hoverHeight             = 2.0;
      createHoverHeight       = 2.0;

(i already played with it a little)



Second question:
If i change a value and have the vehicle spawned, is it enough to reexec the script via console to change for example the forces (or other values) to have them changed ingame?

thx

edit: full code


Code: [Select]
//we want to use the jeep datablocks if we can

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

   //Shapebase Fields
      shapeFile   = "./paperplane01.dts";  //.dts File
      emap        = true;
      mass        = 100;
      drag        = 0.1;
      density     = 100;
     
      maxDamage = 100.00;
      destroyedLevel = 100.00;
      speedDamageScale = 1.04;
      collDamageThresholdVel = 20.0;
      collDamageMultiplier   = 0.02;

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


      lookUpLimit = 1;
lookDownLimit = 0.35;

   //Vehicle Fields:
      jetForce          = 13500;
      jetEnergyDrain    = 0;
      minJetEnergy      = 1;

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

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

      maxDrag        = 20;
      minDrag        = 4100;
      integration    = 4;
      collisionTol   = 0.1;
      contactTol     = 0.1;

      cameraRoll     = false;
      cameraMaxDist  = 13;       
      cameraLag      = 2.0;
      cameraDecay    = 3.0;
      cameraOffset   = 2.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;

      splash = vehicleSplash;
      splashVelocity = 4.0;
      splashAngle = 67.0;
      splashFreqMod = 300.0;
      splashVelEpsilon = 0.60;
      bubbleEmitTime = 1.4;
      splashEmitter[0] = vehicleFoamDropletsEmitter;
      splashEmitter[1] = vehicleFoamEmitter;
      splashEmitter[2] = vehicleBubbleEmitter;
      mediumSplashSoundVelocity = 10.0;   
      hardSplashSoundVelocity = 20.0;   
      exitSplashSoundVelocity = 5.0;

      exitSplashSoundVelocity    = 2.0;
      softSplashSoundVelocity    = 1.0;
      mediumSplashSoundVelocity  = 2.0;
      hardSplashSoundVelocity    = 3.0;
      //exitingWater               = ;   //AudioProfile
      //impactWaterEasy            = ;   //AudioProfile
      //impactWaterMedium          = ;   //AudioProfile
      //impactWaterHard            = ;   //AudioProfile
      //waterWakeSound             = ;   //AudioProfile

      collDamageThresholdVel  = 20;
      collDamageMultiplier    = 0.05;

   //For Wrench Gui
      uiName   = "Paperplane";
      rideAble = true;
      paintable = true;

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

      maneuveringForce        = 70000;
      horizontalSurfaceForce  = 0;
      verticalSurfaceForce    = 0;
      autoInputDamping        = 0.1;
      steeringForce           = 50; //this is left/right
      steeringRollForce       = 0;
      rollForce               = 0;
      autoAngularForce        = 10;
      rotationalDrag          = 1;
      autoLinearForce         = 1;
      maxAutoSpeed            = 10;
      hoverHeight             = 2.0;
      createHoverHeight       = 2.0;

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

      minTrailSpeed        = 1;
      vertThrustMultiple   = 1.0;
   
   //Tagged fields for damage
      initialExplosionProjectile = vehicleExplosionProjectile;
      initialExplosionOffset = 0;         //offset only uses a z value for now

      burnTime = 500;

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

      minRunOverSpeed    = 2;   //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
};


« Last Edit: April 05, 2012, 12:34:02 PM by Schorle »

1st question: Can you pm me when you find out? I've needed to know this for a little while now.

Second question: There might be a way to change little values in-game without reexecuting the script, though those changes would be lost on server shutdown. It would be done in the console though, so once you found one you liked you could shutdown and go back through console.log and check the last one that was put in.

I guess i found it:

Code: [Select]
      maxDrag        = 100;
      minDrag        = 100;
      integration    = 4;
      collisionTol   = 0.1;
      contactTol     = 0.1;

-->lowered drag

maneuveringForce = Horizontal thrust force.

says Torque Appendix

I also changed

Code: [Select]
      maneuveringForce        = 3000;
      horizontalSurfaceForce  = 1;
      verticalSurfaceForce    = 1;
      autoInputDamping        = 0.0;
      steeringForce           = 50; //this is left/right
      steeringRollForce       = 1;
      rollForce               = 1;
      autoAngularForce        = 1;
      rotationalDrag          = 1;
      autoLinearForce         = 1;
      maxAutoSpeed            = 1;
      hoverHeight             = 2.0;
      createHoverHeight       = 2.0;

Every force to 1, because i have the feeling if i set it to 0, something bad will happen (it worked while testing, but you never know...)


I think it's actually something to do with engineforce or enginespeed or something, but it isn't restated because it already exists in the jeep code.