Page 1 of 1

car Angles

Posted: Thu Aug 04, 2005 6:39 am
by jonas
:D I know you guys are probably sick of me asking question about getting in cars and driving them and stuff! But I still need to know another thing, :) How can I set the gen1car script to were if the road slants up it doesn't just keep going straight and plow throught the concrete, but goes up!

Posted: Sat Aug 06, 2005 3:14 am
by hike1
Pickles made a game called O.G.R.E. that had
the vehicles going up hills. If you can find the
game, study the scripts. They say the vehicles go up ramps, but the player viewpoint doesn't change, my car just stops at ramps.

Posted: Sat Aug 06, 2005 6:01 pm
by Guest
This is the function from ogre that handled the terrain folowing for the tanks...

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: Select all

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();
}]

Posted: Sat Aug 06, 2005 10:26 pm
by jonas
Does guest know were I might be able to get a hold of O.G.R.E? :roll:

thanks for the info! :D

Posted: Sat Aug 06, 2005 10:31 pm
by Guest
I'm sorry that I haven't had the demos online since the recent changes, but I will get them online this week and then kindly ask Quest to post a link in the demos section. Again, sorry about that folks.

Posted: Sat Aug 06, 2005 10:33 pm
by jonas
That would be great! I'm glad that the demo are finally coming back! I was kinda worried that they would be back but I guess I'm just crazy!

Posted: Mon Sep 05, 2005 9:50 pm
by ZenBudha
Another method might be by using 2 pawns for the front and rear tires. Having them check their angles to each other, and then having the car body as the third pawn. It checks the angles between the two pawns, and set it's angle (or pitch) accordingly.

Kind of like having the back tires pawn constantly adjust it's pitch to aim at the front tires pawn. Then having the car body pawn setting it's angle to match the back tires pawns angle.

This way the car will always match the terrain pitch exactly. Could even use 4 pawns 1 for each tire to get side to side tilting as well.

Posted: Mon Sep 05, 2005 11:23 pm
by hike1
http://www.mapvault.com/uploads/rf/


While you're waiting for OGRE, you can get RF fighting demo,
fif_setup.rar, and operation spyerwolf, and brawl, 4 of Pickle's games, not to mention my personal favorite

http://asylum.rfactory.org/asylumdemo.exe