Blockland Forums > Modification Help

Converted the Citi MK2 to FWD, doesn't work, what's wrong?

Pages: (1/4) > >>

Sideswipe:

I've attempted to FWD-ize the Citi MK2 which is (very unrealistically) AWD by default by adding this into the .cs file (stuff in bold was what I added)
What's wrong here?


--- Quote from: CitiMK2.cs ---datablock WheeledVehicleData(CitiMk2Vehicle)
{
   isCustom=1;
   type="CitiMk2";
   uiName = "Citi Mk2";
   
   shapeFile = "./CitiMk2.dts";
   category = "Vehicles";
   displayName = " ";
   emap = true;
   minMountDist = 3;
   
   numMountPoints = 4;
   mountThread[0] = "sit";
   mountThread[1] = "sit";
   mountThread[2] = "sit";
   mountThread[3] = "sit";

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

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

   maxSteeringAngle = 0.7;  // 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 = 8.5;         // Far distance from

vehicle
   cameraOffset = 3.4;        // 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.2;
   collisionTol = 0.1;        // Collision distance

tolerance
   contactTol = 0.1;

   useEyePoint = false;   

   defaultTire   = CitiMk2Tire;
   defaultSpring   = CitiMk2Spring;
   flatTire   = jeepFlatTire;
   flatSpring   = jeepFlatSpring;

   numWheels = 4;

   // Rigid Body
   mass = 200;
   density = 5.0;
   drag = 4.5;
   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 = 2400;   //teneksi   3000;

//4000;       // Engine power
   engineBrake = 600;   //teneksi   700;       

  // Braking when throttle is 0
   brakeTorque = 2000;   //teneksi   3200;     

  // When brakes are applied
   maxWheelSpeed = 37;   //teneksi   42;       

// Engine scale by current speed / max speed

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

   // Advanced Steering
     steeringAutoReturn = true;
     steeringAutoReturnRate = 1;
     steeringAutoReturnMaxSpeed = 10;
    steeringUseStrafeSteering = true;
    steeringStrafeSteeringRate = 0.08;
   
   // Energy
   maxEnergy = 100;
   jetForce = 3000;
   minJetEnergy = 30;
   jetEnergyDrain = 2;

   splash = jeepSplash;
   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;
   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;

   handsOnVehicle = 1;

   numDmgEmitterAreas = 1;


   initialExplosionProjectile =

CitiMk2ExplosionProjectile;
   initialExplosionOffset = 0;         //offset only uses

a z value for now

   burnTime = 4000;

   finalExplosionProjectile =

CitiMk2FinalExplosionProjecti le;
   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
};
Garage_AddParts("add-ons/Vehicle_CitiMk2/CitiMk2.txt");

function CitiMk2Vehicle::onAdd(%this,%obj)
{
   Parent::onAdd(%this,%obj);
   %obj.playthread(0,"propslow");
 %obj.hideNode(lhand);
 %obj.hideNode(rhand);
 %obj.hideNode(lhook);
 %obj.hideNode(rhook);
 %obj.setWheelPowered(0, true );
 %obj.setWheelPowered(1, true );
 %obj.setWheelPowered(2, false );   
 %obj.setWheelPowered(3, false );
 %obj.schedule(0,garageDefault);
}
--- End quote ---

Why doesn't this work? Is there anything missing?

Filipe:

Remove the spaces surrounding the words true and false, like this.
%obj.setWheelPowered(0,true);
 %obj.setWheelPowered(1,true);
 %obj.setWheelPowered(2,false);   
 %obj.setWheelPowered(3,false);

Conan:


--- Quote from: Filipe on November 11, 2017, 05:36:46 PM ---Remove the spaces surrounding the words true and false, like this.
%obj.setWheelPowered(0,true);
 %obj.setWheelPowered(1,true);
 %obj.setWheelPowered(2,false);   
 %obj.setWheelPowered(3,false);

--- End quote ---
this isnt necessary afaik

how is it not working? can you clarify what isnt working? can the vehicle drive at all?

Ipquarx:


--- Quote from: Conan on November 11, 2017, 06:39:10 PM ---this isnt necessary afaik

--- End quote ---
it isnt, and it actually makes it less readable

Sideswipe:


--- Quote from: Conan on November 11, 2017, 06:39:10 PM ---this isnt necessary afaik

how is it not working? can you clarify what isnt working? can the vehicle drive at all?

--- End quote ---

The car is still AWD. Everything else works fine.
EDIT: Also, no syntax errors according to console.
EDIT 2: Also also, this worked on the Club along with some other vehicles.

Pages: (1/4) > >>

Go to full version