Author Topic: "Drifting"  (Read 1282 times)

So is it possible to make a car drift in Blockland?

What if you were to just apply brakes on the back wheels only?

I've read something about being able to apply impulse to the sides of a car to make it "spin". Would you be able to apply this to making a controlled drift?
« Last Edit: January 30, 2008, 07:59:16 PM by NoZoner »

I've been able to do it with really fast cars but its only a little, but it would be cool if you could do a real drift.

So is it possible to make a car drift in Blockland?

What if you were to just apply brakes on the back wheels only?

I've read something about being able to apply impulse to the sides of a car to make it "spin". Would you be able to apply this to making a controlled drift?
Yes, I was playing Halo 3 today and thought that.

I think an impulse would just push the entire car instead of the area that it's pushing against.

I think an impulse would just push the entire car instead of the area that it's pushing against.

I should have specified: :P. I meant impulse on the side of the wheel at a certain angle.

First Ephi, then Teatree, now you! Everyone is using fancy avatars now... I'm getting one...

Anyways, back on topic: I know that some cars while in beta drift which means it is fairly possible. I'm pretty sure one of bushi's cars has a drifty thing.

Yeah, it has to do with how the springs are defined for dampening, etc.

As for having it work with any wheeled vehicle, you could modify this spin-out code I whipped up for Aloshi.

Code: [Select]
function startspinout(%vehicle,%timeinseconds,%impactvector,%impulse)
{
if(isObject(%vehicle) && %vehicle.getClassName() $= "WheeledVehicle")
{
schedule(%timeinseconds * 1000,0,"stopspinout",%vehicle);
%vehicle.eulerRot = 1;
%vehicle.impulsedecline = %impulse / %timeinseconds / 100;
%vehicle.spinout = 1;
%vehicle.setTransform(%vehicle.position SPC eulerToAxis(getWords(axisToEuler(getWords(%vehicle.getTransform(),3,6)),0,1) SPC %vehicle.eulerRot));
%velX = getWord(%impactVector,0) * %impulse + getWord(%vehicle.getVelocity(),0);
%velY = getWord(%impactVector,1) * %impulse + getWord(%vehicle.getVelocity(),1);
%velZ = getWord(%vehicle.getVelocity(),2);
%vehicle.setVelocity(%velX SPC %velY SPC %velZ);
schedule(10,0,"continuespinout",%vehicle,%impactvector,%impulse - %vehicle.impulsedecline);
}
}

function continuespinout(%vehicle,%impactvector,%impulse)
{
if(isObject(%vehicle) && %vehicle.getClassName() $= "WheeledVehicle")
{
if(%vehicle.eulerRot < 359)
{
%vehicle.eulerRot += 1;
}
else
{
%vehicle.eulerRot = 0;
}

%vehicle.setVelocity("0 0" SPC getWord(%vehicle.getVelocity(),2));
%vehicle.setTransform(%vehicle.position SPC eulerToAxis(getWords(axisToEuler(getWords(%vehicle.getTransform(),3,6)),0,1) SPC mCeil(%vehicle.eulerRot)));
%velX = getWord(%impactVector,0) * %impulse + getWord(%vehicle.getVelocity(),0);
%velY = getWord(%impactVector,1) * %impulse + getWord(%vehicle.getVelocity(),1);
%velZ = getWord(%vehicle.getVelocity(),2);
%vehicle.setVelocity(%velX SPC %velY SPC %velZ);

if(%vehicle.spinout)
{
schedule(10,0,"continuespinout",%vehicle,%impactvector,%impulse - %vehicle.impulsedecline);
}
}
}

function stopspinout(%vehicle)
{
if(isObject(%vehicle) && %vehicle.getClassName() $= "WheeledVehicle")
{
%vehicle.spinout = "";
%vehicle.eulerRot = "";
%vehicle.impulsedecline = "";
}
}