Cars won't go up or down hills

Post your Feature Requests here...
Post Reply
hike1
RF FAQ-Keeper
Posts: 607
Joined: Tue Jul 05, 2005 4:19 am
Contact:

Cars won't go up or down hills

Post by hike1 » Sat Aug 06, 2005 8:46 pm

From 'car angles', not really a bug, but I know that the programmers read this thread sometimes..



Like anything done in an RF game, it is a hack. It simply tests to see whether or not the tank is going up or down and then tilting the tank either up or dwn to match. THe trick is that the level must be made with a Y value that is positivie. (ie, it must be built above 0 Y)

However, the same thing can be done nowadays with a single command if anyone wished to add it. All it would have to do is perform collison test from each corner of the bounding box and then align itself to match the required angle. Anywyas here's the funtion from the original OGRE script from the tanks.

Code:

CheckAngles[()
{
if(self.current_Y != LASTPITCH)
{
debug(DIR);
switch(DIR)
{
case 0
{
if(self.current_Y > LASTPITCH)
{
self.ideal_pitch=(15)*0.0174532925199433;
}
else
{
self.ideal_pitch=(-15)*0.0174532925199433;
}
}

case 90
{
if(self.current_Y < LASTPITCH)
{
self.ideal_pitch=(15)*0.0174532925199433;
}
else
{
self.ideal_pitch=(-15)*0.0174532925199433;
}
}

case 180
{
if(self.current_Y > LASTPITCH)
{
self.ideal_pitch=(-15)*0.0174532925199433;
}
else
{
self.ideal_pitch=(15)*0.0174532925199433;
}
}

case 270
{
if(self.current_Y > LASTPITCH)
{
self.ideal_pitch=(-15)*0.0174532925199433;
}
else
{
self.ideal_pitch=(15)*0.0174532925199433;
}
}
}
}
else
{
self.ideal_pitch=0;
}
LASTPITCH=self.current_Y;
ChangePitch();
}]

Post Reply