Author Topic: FAST Minijet  (Read 1891 times)

So recently I have been moding the Minijet script to make the FASTEST flying thing in blockland ever. I got the little jet going really fast already but I was hoping you guys could help me make it faster.
Quote
datablock WheeledVehicleData(ChrisVehicle)
{
   category = "Vehicles";
   displayName = " ";
   shapeFile = "./Chris.dts";
   emap = true;
   minMountDist = 3;
   
   numMountPoints = 1;
   mountThread[0] = "sit";

   maxDamage = 100.00;
   destroyedLevel = 100.00;
   energyPerDamagePoint = 160;
   speedDamageScale = 1.04;
   collDamageThresholdVel = 20.0;
   collDamageMultiplier   = 0.02;

   massCenter = "0 0 0";
   //massBox = "2 5 1";

   maxSteeringAngle = 0.9785;  // Maximum steering angle, should match animation
   integration = 4;           // Force integration time: TickSec/Rate
   tireEmitter = VehicleTireEmitter; // All the tires use the same dust emitter

   // 3rd person camera settings
   cameraRoll = false;         // Roll the camera with the vehicle
   cameraMaxDist = 10;         // Far distance from vehicle
   cameraOffset = 7.5;        // Vertical offset from camera mount point
   cameraLag = 0.0;           // Velocity lag of camera
   cameraDecay = 0.75;        // Decay per sec. rate of velocity lag
   cameraTilt = 0.4;
   collisionTol = 0.1;        // Collision distance tolerance
   contactTol = 0.1;

   useEyePoint = false;   

   // defaultTire   = biplaneTire;
   // defaultSpring   = biplaneSpring;
   // flatTire   = biplaneFlatTire;
   // flatSpring   = biplaneFlatSpring;

   //numWheels = 3;

   // Rigid Body
   mass = 200;
   density = 5.0;
   drag = 0.6;
   bodyFriction = 0.6;
   bodyRestitution = 0.6;
   minImpactSpeed = 10;        // Impacts over this invoke the script callback
   softImpactSpeed = 10;       // Play SoftImpact Sound
   hardImpactSpeed = 15;      // Play HardImpact Sound
   groundImpactMinSpeed    = 10.0;

   // Engine
   engineTorque = 6000; //4000;       // Engine power
   engineBrake = 2000;         // Braking when throttle is 0
   brakeTorque = 4000;        // When brakes are applied
   maxWheelSpeed = 20;        // Engine scale by current speed / max speed

   rollForce      = 900;
   yawForce      = 600;
   pitchForce      = 1000;
   rotationalDrag      = 0.2;

   // Energy
   maxEnergy = 100;
   jetForce = 3000;
   minJetEnergy = 30;
   jetEnergyDrain = 2;

   isSled = false;

   forwardThrust      = 204800000;   // Change me up (i doubbled all change me values)
   reverseThrust      = 2000;
   lift         = 10240000;   
   maxForwardVel      = 2560000;   
   maxReverseVel      = 40;
   horizontalSurfaceForce   = 130;   // Horizontal center "wing" (provides "bite" into the wind for climbing/diving and turning)
   verticalSurfaceForce   = 130;
   rollForce      = 3200000;   
   yawForce      = 4800000; 
   pitchForce      = 4800000; 
   rotationalDrag      = 0.5;
   stallSpeed      = 10;


   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;
      
   //mediumSplashSound = "";
   //hardSplashSound = "";
   //exitSplashSound = "";
   
   // Sounds
   //   jetSound = ScoutThrustSound;
   //engineSound = idleSound;
   //squealSound = skidSound;
   softImpactSound = slowImpactSound;
   hardImpactSound = fastImpactSound;
   //wheelImpactSound = slowImpactSound;

   //   explosion = VehicleExplosion;
   justcollided = 0;

   uiName = "Chris ";
   rideable = true;
      lookUpLimit = 0.50;
      lookDownLimit = 0.50;

   paintable = true;
   
   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;

   numDmgEmitterAreas = 1;

   initialExplosionProjectile = ChriloveplosionProjectile;
   initialExplosionOffset = 0;         //offset only uses a z value for now

   burnTime = 4000;

   finalExplosionProjectile = ChrisFinalExplosionProjectile;
   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
   
      // Advanced Steering
   steeringAutoReturn = false;
   // steeringAutoReturnRate = 0.9;
   // steeringAutoReturnMaxSpeed = 10;
   steeringUseStrafeSteering = false;
   // steeringStrafeSteeringRate = 0.1;
   
   // minContrailSpeed = 30;
   
   minJetEngineSpeed = 20;
};

function Chrisvehicle::onadd(%this,%obj)
{
   parent::onadd(%this,%obj);
      
   %obj.setWheelTire(0, Christire);
   %obj.setWheelTire(1, Christire);
   %obj.setWheelTire(2, Christire);

   %obj.setWheelSpring(0, ChrisSpring);
   %obj.setWheelSpring(1, ChrisSpring);
   %obj.setWheelSpring(2, ChrisSpring);
   
   %obj.setWheelSteering(0,0);
   %obj.setWheelSteering(1,0);
   %obj.setWheelSteering(2,-1);

   %obj.setWheelPowered(0,true);
    %obj.setWheelPowered(1,true);
   %obj.setWheelPowered(2,true);
      
   JetEngineCheck(%obj);
}

I'm going to assume you simply replaced every use of the word minijet with "Chris" and that you have no idea what any of what you changed means.

Oh, also, there is a speed limit in torque that you cannot exceed. Furthermore, what good is speed if you cannot steer the thing?

I renamed all the minijet files to Chris so I could have both the minijet vehicle and the "Chris" vehicle in the same level. As for there being a speed limit I guess I have reached it. Thanks for the help. :cookieMonster:

O and I recommend you trying this out on your minijet. Steering is pretty good still and it flys really really fast, its awesome.

I renamed all the minijet files to Chris so I could have both the minijet vehicle and the "Chris" vehicle in the same level.
Problem is everyone has to download everything twice.

BB Code tip: use [ code ] for code and [ quote ] for quotes, not [ quote ] for code.

Here should be all you really need as the entirety of your server.cs file:
Code: [Select]
%error = ForceRequiredAddOn("Vehicle_Minijet");

if(%error == $Error::AddOn_Disabled)
MinijetVehicle.uiName = "";

if(%error == $Error::AddOn_NotFound)
error("ERROR: Bad Minijet - required add-on Vehicle_Jeep not found");
return;
}

$badPlaneVehicle::velScaleFactor = mFloor(MinijetVehicle.maxForwardVel / 200);

datablock WheeledVehicleData(badPlaneVehicle : MinijetVehicle) { //4 times faster than normal.
//Based on fields as of RTB3 Add-On #521 ("Mini Jet (v1)")

uiName = "Bad Minijet"; //Originally: "Minijet "; (Yes it did have that space at the end, I have no clue why.)

//The following are most likely worth fine tuning.
//drag = 0.6;
//bodyFriction = 0.6;
//rotationalDrag = 0.2;

//Based on the definition of restitution,
//I think this may be about acceleration after stalling.
bodyRestitution = MinijetVehicle.bodyRestitution * $badPlaneVehicle::velScaleFactor;

engineTorque = MinijetVehicle.engineTorque * $badPlaneVehicle::velScaleFactor;
engineBrake = MinijetVehicle.engineBrake * $badPlaneVehicle::velScaleFactor;
brakeTorque = MinijetVehicle.brakeTorque * $badPlaneVehicle::velScaleFactor;
maxWheelSpeed = MinijetVehicle.maxWheelSpeed * $badPlaneVehicle::velScaleFactor;

minJetEngineSpeed = MinijetVehicle.minJetEngineSpeed * $badPlaneVehicle::velScaleFactor;

minImpactSpeed = MinijetVehicle.minImpactSpeed * $badPlaneVehicle::velScaleFactor;
softImpactSpeed = MinijetVehicle.softImpactSpeed * $badPlaneVehicle::velScaleFactor;
hardImpactSpeed = MinijetVehicle.hardImpactSpeed * $badPlaneVehicle::velScaleFactor;
groundImpactMinSpeed = MinijetVehicle.groundImpactMinSpeed * $badPlaneVehicle::velScaleFactor;

rollForce = MinijetVehicle.rollForce * $badPlaneVehicle::velScaleFactor;
yawForce = MinijetVehicle.yawForce * $badPlaneVehicle::velScaleFactor;
pitchForce = MinijetVehicle.pitchForce * $badPlaneVehicle::velScaleFactor;

forwardThrust = MinijetVehicle.forwardThrust * $badPlaneVehicle::velScaleFactor;
reverseThrust = MinijetVehicle.reverseThrust * $badPlaneVehicle::velScaleFactor;
lift = MinijetVehicle.lift * $badPlaneVehicle::velScaleFactor;
maxForwardVel = MinijetVehicle.maxForwardVel * $badPlaneVehicle::velScaleFactor;
maxReverseVel = MinijetVehicle.maxReverseVel * $badPlaneVehicle::velScaleFactor;
horizontalSurfaceForce = MinijetVehicle.horizontalSurfaceForce * $badPlaneVehicle::velScaleFactor;
verticalSurfaceForce = MinijetVehicle.verticalSurfaceForce * $badPlaneVehicle::velScaleFactor;
rollForce = MinijetVehicle.rollForce * $badPlaneVehicle::velScaleFactor;
yawForce = MinijetVehicle.yawForce * $badPlaneVehicle::velScaleFactor;
pitchForce = MinijetVehicle.pitchForce * $badPlaneVehicle::velScaleFactor;
rotationalDrag = MinijetVehicle.rotationalDrag * $badPlaneVehicle::velScaleFactor;
stallSpeed = MinijetVehicle.stallSpeed * $badPlaneVehicle::velScaleFactor;

minRunOverSpeed = MinijetVehicle.minRunOverSpeed * $badPlaneVehicle::velScaleFactor;
collDamageThresholdVel = MinijetVehicle.collDamageThresholdVel * $badPlaneVehicle::velScaleFactor;

//Dividing instead of multiplying these on purpose.
collDamageMultiplier = MinijetVehicle.collDamageMultiplier / $badPlaneVehicle::velScaleFactor;
burnTime = 4000 / $badPlaneVehicle::velScaleFactor;
runOverDamageScale = 5 / $badPlaneVehicle::velScaleFactor;
runOverPushScale = runOverPushScale / $badPlaneVehicle::velScaleFactor;

// These values are commented out as of the version specified above, however I set them anyway.
//I set them to 1 when necessary in order to avoid scaling a value that evaluates to 0 to begin with.
steeringAutoReturnRate = (MinijetVehicle.steeringAutoReturnRate $= "" || MinijetVehicle.steeringAutoReturnRate == 0 ? MinijetVehicle.steeringAutoReturnRate : 1) * $badPlaneVehicle::velScaleFactor;
steeringAutoReturnMaxSpeed = (MinijetVehicle.steeringAutoReturnMaxSpeed $= "" || MinijetVehicle.steeringAutoReturnMaxSpeed == 0 ? MinijetVehicle.steeringAutoReturnMaxSpeed : 1) * $badPlaneVehicle::velScaleFactor;
steeringStrafeSteeringRate = (MinijetVehicle.steeringStrafeSteeringRate $= "" || MinijetVehicle.steeringStrafeSteeringRate == 0 ? MinijetVehicle.steeringStrafeSteeringRate : 1) * $badPlaneVehicle::velScaleFactor;
minContrailSpeed = (MinijetVehicle.minContrailSpeed $= "" || MinijetVehicle.minContrailSpeed == 0 ? MinijetVehicle.minContrailSpeed : 1) * $badPlaneVehicle::velScaleFactor;
};

function badPlaneVehicle::onadd(%this,%obj) {
MiniJetvehicle::onadd(%this,%obj);
}

Note: I haven't tested this.

« Last Edit: October 01, 2009, 10:27:50 PM by BobAndRob »

Ok here is the download link:      http://www.cjbarker.com/subpages/Vehicle_Chris.zip

Have fun with my fast jet. FYI getting into the vehicle is a little tricky but it is a lot of fun.

Pro tip: Start a minigame first and set the "/timescale 2" once your in flight. This = awesome.

Ok here is the download link:      http://www.cjbarker.com/subpages/Vehicle_Chris.zip

Have fun with my fast jet. FYI getting into the vehicle is a little tricky but it is a lot of fun.

Pro tip: Start a minigame first and set the "/timescale 2" once your in flight. This = awesome.
I take it that my code works then?

If your vehicle goes so fast that it collides with the terrain and it's wheels go up and into the vehicle due to the force, and the body of the vehicle collides with the terrain where the wheels should be, the game will crash. Trust me here, I messed about with game-breaking experiments for a while.

BobandRob  Na I am not very good a messing with code so I didn't change anything. If you would like to make your own changes to it and post it back up that would be really cool.

Deathwish  Prob not the kind of vehicle you should use on a level like the bedroom... its a little too fast for that. I always use it on the slopes level... and as for it crashing the game... it has never crashed mine so I am not sure why it would crash yours... sry man

BobandRob  Na I am not very good a messing with code so I didn't change anything. If you would like to make your own changes to it and post it back up that would be really cool.
-snip-
... Look 5 posts above this one.

Once you read what your changing it becomes pretty obvious

If it was any faster you wouldnt beable to control it.