NOTICE: This tutorial is currently a bit out of date, it will be updated as soon as I find time for it!
Nowadays in Garry's Mod, a lot of people fall for cars and there's nothing wrong with it. They are usually small, fun to play with on almost every map and generally a lot of fun. Of course, there has to be a catch, they are not easy to construct and the whole community expects very high quality, since some people earn lots of respect by dedicating their free time to refine their vehicles to the max.
The thing is, I have met many people who are absolutely great at building bodies but are absolutely helpless at doing suspensions or anything with wiremod. Those people are mostly friends and thus I feel obliged to help. Sadly, chatting or speaking is momentary and I'm repeating myself most of the time.
The purpose of writing this tutorial is to give an alternative to all those video tutorials and instead, sharing my current knowledge of chassis building with everyone.
First of all, here is a list of addons which I recommend for building chassis with.
You can find them in the Addon/SVN List. Now to start working, we need a few props/entities.
To apply MakeSpherical to your wheels, just take out the tool and left-click your wheels.
The large grey plate is my base plate, I normally think of it as the underside of your car. Choose it wisely, it will be your cars hitbox, if you ignore the wheels.
The smaller grey plate is my steering master and although you can see lots of people using much smaller props for it, I recommend it for the best stability and duplicating compatibility.
The little orange stick, is a PHX super flat bar (models/Squad/sf_bars/sf_bar25x25x4.mdl) and from experiences, it appears to be the most stable wheel master for high speeds.
In order for us to finally start building the actual suspension, we need to position all props in the right direction. It is very important for your suspension to face north/south while building and spawning. If you do not have a HUD or radar to show you north, you can use this little trick. In multiplayer, you can put your spray image on the ground and the top end of it will always face north. In singleplayer, you will have to use the paint tool and select the smile decal and spray it on the ground, the direction, where the nose/eyes would be, is north - as you can see here:
Now you can either use the Easy Precision or Precision Alignment tool to move the wheels onto the chassis. With either the offset/inset function while moving or after positioning by nudging, you can define the width of the car. It will basically look like this:
As you can see I didn't nudge my wheels, because I thought the width was fine. There is one important thing which needs to be done; use the No Collide tool to nocollide the wheels to the base plate.
After doing that, we will just Easy Precision axis the steering master to the base. For weight balancing reasons, I would choose the middle.
And finally, we have to EP move the wheel master to a position on the base plate, where we would like the engine to be placed. Remember, that weight balance is an important part of how your car will drive in the end. For my purposes, I am putting the wheel master in the rear, because I would like to have a rear-engine, rear-wheel-drive layout. In order for the wheel master to spin, we will have to equip the Axis Centre tool (which is part of Wenli's tools) and apply the axis constraint from the side of the wheel master to the side of the chassis - twice (to ensure stability at high speeds). The clicking order with the Axis Centre tool is really important:
Now that we have placed all chassis parts, we use the No Collide tool's right-click mode to make the steering master and the wheel master nocollided to everything. If you've followed me, it should look like this:
You can do this step using the normal rope tool or by using Precision Alignment rope placing like me. Basically we are going to place rigid ropes from the centre of the wheel to the opposing chassis edges.
So we use Point - Mass Centre in PA (Precision Alignment) to place a point at the mass centre of each wheel. Then I am going to use Point - Hitpos with the boxes Snap to Edges and Snap to Centre Lines ticked to select all edges of the base plate. It will look like this:
I am now opening the tool's Manipulation Panel with R and select Constraints -> Rope, make sure Rigid is selected, Add Length and Set Length is 0 and everything else is set to your liking.
If you take my point placing as an example, I am now going to constraint these points:
Did you get lost in the confusing PA forest? Here's a collection of images in an order, explaining what you need to do:
Now I am going to place wire hydraulics from the wheel centre to an imaginary point 30 units straight up with the aid of PA.
First of all, we will spawn an auxiliary plate where we can put all those hydraulic controllers and later gates we are going to use for building this. Now we take the wire hydraulic tool to just randomly click each wheel and then the base. To keep it simple, we will place the hydraulic controllers in a rectangle, so we can check later on, which hydraulic connects to which wheel.
Again, we're going to use the PA tool and we have to place point 5 to 8 again right again with Point - Mass Centre over the already existing points in the wheels. Because we can't attach hydraulics to the same object, we need to right-click select the base plate so that it becomes coloured and then in the Q/C menu of PA, we select each point (5 to 8) and click on Attach.
To move the points up, we keep the base plate selected, open the R menu, go to Points, select point 5, check Relative to Entity and put the value, which is now 0 (or about 0) to 30 or so and click set. To continue with the other 3 points, you need to click on them, then untick Relative to Entity and tick it again. If you've been able to follow me, you should have a result looking like this:
Now you need to right-click each Hydraulic Controller in order to select it and then use the R menu, Constraints -> Wire Hydraulic and connect the corresponding points.
So I would start with the lower left controller and connect point 1 to point 5. At the end it will look like this:
Got lost again? Here's a collection of images in an order, explaining what you need to do:
If you wish, you can now delete all PA points. For our suspension hydraulics to have serious effect on the suspension and resetting themselves after duplicating, I recommend using an Expression 2 like this and placing it on your controller plate:
You need to adjust the settings to the weights of your car and your liking. The E2 differs between front and rear suspension since your weight balance might be different.
C(onstant) is the general strength of the hydraulic and should be between 30000 and 50000.
D(amping) is the strength of the shock absorbing. It should be between 1000 and 50000 if your chassis is really really heavy, but go for a low value first - if your damping is too high, your suspension will spaz out.
L(ength) will define the height of your chassis. Remember: the lower your chassis is, the more controllable it will be, but if it's too low, you can't go over terrain.
The heart of a suspension - the tool that makes your wheels not flop around. Now I will give you a bunch of settings for the Ball Socket - Advanced tool, which you need to enter and save as preset.
The order when applying ballsockets does not matter:
It's often helpful to ballsocket the two wheels that will not be powered by the engine together, aka the steering. We can do this using our ballsocket settings wheelmaster, this makes our driving experience more comfortable. (e.g. the rear wheels on a front-wheel-drive car)
I'm sure that you feel confident, content and definitely sure that you can create the Steering Hydraulics without PA, if you are careful enough with SmartSnap. However, it is very important though that both hydraulics have the same length, otherwise your car will NOT drive straight.
You basically just apply two hydraulics on the steering master and put the controllers on your plate:
Since your hydraulics are pretty much useless, that is, if you don't have a good way of controlling them, I'm giving you my personal steering Expression 2, which you can place on your controller plate:
If you are not using the mouse steering beta, which you shouldn't, you don't have to wire the Controller:wirelink, you just wire Left and Right to your pod controller and Hl and Hr to your left and your right hydraulic. If the steering is inverted, swap the wiring of Hl and Hr.
Before that code is ready to go, you definitely need to set the Norm value to an accurate value of your both steering hydraulics; the length of them, while your steering plate is centered. In my case that would be 33.211. You can adjust Speed and Lock to your liking.
With the Physical Properties tool, you can fine tune the traction and effect on your tyres. Make sure Gravity toggle is ticked and keep your console ready. In the list you can already find the rubber material, thats the stock material of tyres. It works, but it doesn't have much grip. If you are aiming for more grip, there are a few others, which you have to enter in the console and then click with the tool like this: physprop_material insertyourmaterialhere
Friction: this is the physical friction (0 - 1.0, 0.01 is slick, 1.0 is totally rough)
Elasticity: This is the collision elasticity (0 - 1.0, 0.01 is soft, 1.0 is hard)
Your suspension is practically ready, but you may want to learn how to power your Car realistically (without thrusters, ect.); Wheel Power. Here is some simple Expression 2 code from which you can learn from. You will need a wire Entity Marker which is being linked to your wheel master and then use this E2:
All needed instructions are in the E2 itself and with a general understanding of code, you can fix any glitches you are getting.
Now that you have created your first independent suspension, I would like to share with you some rather useful information regarding wheel power. After Wheel2's release, most servers have an
increased maximum angular velocity limit, this allows us to pump more torque out of our wheels.
To do this in Singleplayer, simply enter this line into the Console:
lua_run physenv.SetPerformanceSettings({MaxAngularVelocity = 8000})
Please note however, this will only take effect in Singleplayer. For it to take effect in Multiplayer, the command MUST be ran by an Admin.
I hope this tutorial has helped you get off to a good start with cars in Garry's Mod. If you have problems, queries or possibly even suggestions/criticism, I'm always happy to address them and possibly discuss them with you. Good Luck!
At this point, I also want to say thanks to Jon for sacrificing his precious time (in which he could not continue saving the galaxy) to proof read this tutorial, fixing over 9000 grammar faults.