Author Topic: RWD drifitng vehicle  (Read 686 times)

A topic was made a few days ago suggesting the possibility of pressing a key to make cars drift.
Topic: http://forum.blockland.us/index.php?topic=255267.0

I then thought about the Shinozaki Spirit (http://forum.blockland.us/index.php?topic=252062.0) which is apparently the only RWD vehicle in Blockland. I think it would be interesting to see if someone could edit the drifting script to work for that car. I dont know if it would be any different from the current drifting vehicles in Blockland already, but I think someone should give it a shot. If it works, someone could possibly make a vehicle that is RWD and drifts when a certain key (such as the crouch keybind) is pressed. I think it would be really cool to see some better drift cars in Blockland, maybe some based off of real drift cars like the Supra or S15.


This is relevant to your RWD interests
Code: [Select]
function ShinozakiSpiritVehicle::onAdd(%this,%obj){
parent::onAdd(%this,%obj);

%obj.setWheelPowered(0,false);
%obj.setWheelPowered(1,false);
}

Huh, this reminds me that the Marussia I've done is actually supposed to be RWD.
Yeah I'll probably tinker with this sometime.

Here's my drifty RWD setup for your pleasure:

Tyres
Code: [Select]
datablock WheeledVehicleTire(GrottiniTire)
{
   // Tires act as springs and generate lateral and longitudinal
   // forces to move the vehicle. These distortion/spring forces
   // are what convert wheel angular velocity into forces that
   // act on the rigid body.
   shapeFile = "./racecarwheel.dts";

mass = 10;
    radius = 1;
    staticFriction = 4.5;
   kineticFriction = 4;
   restitution = 0.5;

   // Spring that generates lateral tire forces
   lateralForce = 8000;
   lateralDamping = 500;
   lateralRelaxation = 1;

   // Spring that generates longitudinal tire forces
   longitudinalForce = 8000;
   longitudinalDamping = 500;
   longitudinalRelaxation = 1;
};

datablock WheeledVehicleTire(GrottiniFrontTire)
{
   shapeFile = "./racecarwheel.dts";

mass = 10;
    radius = 1;
    staticFriction = 3;
   kineticFriction = 4;
   restitution = 0.5;

   lateralForce = 8000;
   lateralDamping = 500;
   lateralRelaxation = 1;

   longitudinalForce = 8000;
   longitudinalDamping = 500;
   longitudinalRelaxation = 1;
};

The vehicle itself:

Code: [Select]
function GrottiniVehicle::onAdd(%this,%obj)
{
parent::onadd(%this,%obj);
%obj.setWheelTire(0, GrottiniFrontTire);
%obj.setWheelTire(1, GrottiniFrontTire);
%obj.setWheelTire(2, GrottiniTire);
%obj.setWheelTire(3, GrottiniTire);

%obj.setWheelSpring(0, Grottinispring);
%obj.setWheelSpring(1, Grottinispring);
%obj.setWheelSpring(2, Grottinispring);
%obj.setWheelSpring(3, Grottinispring);

%obj.setWheelPowered(0, false );
%obj.setWheelPowered(1, false );
%obj.setWheelPowered(2, true );
%obj.setWheelPowered(3, true );

%obj.setWheelSteering(0,1);
%obj.setWheelSteering(1,1);
%obj.setWheelSteering(2,0);
%obj.setWheelSteering(3,0);

%obj.mountable = true;

}