| Blockland Forums > Modification Help |
| Vehicle Steering: Turning onto one side of tires while steering |
| (1/1) |
| Uxie:
--- Code: ---//we need the jeep add-on for this, so force it to load %error = ForceRequiredAddOn("Vehicle_Jeep"); if(%error == $Error::AddOn_Disabled) { //A bit of a hack: // we just forced the jeep to load, but the user had it disabled // so lets make it so they can't select it JeepVehicle.uiName = ""; } if(%error == $Error::AddOn_NotFound) { //we don't have the jeep, so we're screwed error("ERROR: Vehicle_Le_Mans - required add-on Vehicle_Jeep not found"); } datablock WheeledVehicleTire(LeMansTire) { shapeFile = "./lemanstire.dts"; mass = 10; radius = 1; staticFriction = 5; kineticFriction = 5; restitution = 0.5; // Spring that generates lateral tire forces lateralForce = 18000; lateralDamping = 4000; lateralRelaxation = 0.01; // Spring that generates longitudinal tire forces longitudinalForce = 14000; longitudinalDamping = 2000; longitudinalRelaxation = 0.01; }; datablock WheeledVehicleSpring(LeMansBackSpring) { // Wheel suspension properties length = 0.2; // Suspension travel force = 3000; //2000; // Spring force damping = 1000; //1000; // Spring damping antiSwayForce = 2; //1; // Lateral anti-sway force }; datablock WheeledVehicleSpring(LeMansFrontSpring) { // Wheel suspension properties length = 0.3; // Suspension travel force = 3000; //2000; // Spring force damping = 1000; //1000; // Spring damping antiSwayForce = 6; //1; // Lateral anti-sway force }; // Vehicle // ///////////// datablock WheeledVehicleData(LeMansVehicle) { category = "Vehicles"; displayName = " "; shapeFile = "./lemans.dts"; //"~/data/shapes/skivehicle.dts"; // emap = true; minMountDist = 3; numMountPoints = 2; mountThread[0] = "sit"; mountThread[1] = "sit"; maxDamage = 125.00; destroyedLevel = 125.00; speedDamageScale = 1.04; collDamageThresholdVel = 20.0; collDamageMultiplier = 0.02; massCenter = "0 0 0"; //massBox = "2 5 1"; maxSteeringAngle = 0.4; // Maximum steering angle, should match animation integration = 2; // 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 = 13; // 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 = LeMansTire; defaultSpring = LeMansFrontSpring; //flatTire = jeepFlatTire; //flatSpring = jeepFlatSpring; numWheels = 4; // Rigid Body mass = 300; density = 5.0; drag = 1.0; 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 = 3000; //4000; // Engine power engineBrake = 2000; // Braking when throttle is 0 brakeTorque = 4000; // When brakes are applied maxWheelSpeed = 50; // Engine scale by current speed / max speed rollForce = 200; yawForce = 300; pitchForce = 1000; rotationalDrag = 0.2; // Advanced Steering steeringAutoReturn = true; steeringAutoReturnRate = 3.0; steeringAutoReturnMaxSpeed = 10; steeringUseStrafeSteering = true; steeringStrafeSteeringRate = 0.1; // Energy maxEnergy = 100; jetForce = 3000; minJetEnergy = 30; jetEnergyDrain = 2; // Sounds softImpactSound = slowImpactSound; hardImpactSound = fastImpactSound; //wheelImpactSound = slowImpactSound; // explosion = VehicleExplosion; justcollided = 0; uiName = "Le Mans "; rideable = true; lookUpLimit = 0.65; lookDownLimit = 0.45; 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 = LeManloveplosionProjectile; initialExplosionOffset = 0; //offset only uses a z value for now burnTime = 4000; finalExplosionProjectile = LeMansFinalExplosionProjectile; finalExplosionOffset = 0.5; //offset only uses a z value for now minRunOverSpeed = 4; //how fast you need to be going to run someone over (do damage) runOverDamageScale = 8; //when you run over someone, speed * runoverdamagescale = damage amt runOverPushScale = 1.2; //how hard a person you're running over gets pushed }; function LeMansVehicle::onAdd(%this,%obj) { parent::onadd(%this,%obj); %obj.mountable = true; %obj.setWheelSpring(0, LeMansFrontSpring); %obj.setWheelSpring(1, LeMansFrontSpring); %obj.setWheelSpring(2, LeMansBackSpring); %obj.setWheelSpring(3, LeMansBackSpring); } --- End code --- I turn to the right and it flys to the right side of tires. I turn to the left and it flys to the left side of tires. So my question is, how would I keep this lovey thang on its four tires? |
| Uxie:
Bleh, I raised the rotational drag to 20 and it works like a charm. Thanks to Stratofortress. |
| Navigation |
| Message Index |