func_vehicle complete tutorial

A Tutorial for Counter-Strike 1.6

Yo, buddy. We are one of the oldest mod sites on the Interwebs. Sign up and maximize your browsing experience.

  • Subscribe: Get notified of new submissions like this.
  • Say Thanks: Show your appreciation by sending Cd5ssmffan points.
  • Post: Give Cd5ssmffan your thoughts on this Tutorial.
  • Vote: Help Cd5ssmffan win the Monthly Awards.
  • Rate: Give this Tutorial a rating out of 10.
  • Flag: Alert moderators and warn members of a problem with this Tutorial.
  • Watch: Get notified when this Tutorial is updated.
Mascot

Join the community!

Sign up

Already a Bananite? Login

1. Requisites

  • a game configuration file that supports vehicle entities such as this one
  • understanding of 3D space and dimensions

2. Creating an origin for the vehicle

You should already have made a car or at least something at this point. It should be made parallel to the X axis. Here's mine:

To make it work I need to specify the origin of the vehicle centered on the X and Y axes (so you can set length and width correctly). This is done by creating a brush in the middle of your vehicle (marked with a cross) with the origin texture
The axes should be visible in the editor as red, blue and green lines but for the slow:

It doesn't necessarily have to be centered on the Z axis because you can change the height value of your entity later. So now I have something like this:


3. Creating the vehicle entity

At this point you can create a func_vehicle entity with the whole vehicle, origin included. From now on all keyvalues will be highlighted in red. These are the ones you should change:

targetname
The vehicle controls need to target this entity so set a name.
target
Name of the path_track entity the vehicle will spawn at in game, which we will create later.
length
Dimensions of the vehicle on the X axis. Once again, your car should be made front parallel to the X axis so you can set the length/width correctly.
width
Dimensions of the vehicle on the Y axis.
height
This defines how many units the bottom of the origin is above ground. This is useful if your vehicle has wheels, and very useful for boats or helicopters. Making the origin touch the ground and setting this to 0 is acceptable however don't do this due to the buggy nature of vehicles, how they move up slopes etc.

This is how my car looks like so far in the XY graph:

Also my car now faces negative X because of incorrect orientation in-game. the angles value doesn't seem to do anything for me.

There are also settings such as speed, sound, damage and other gimmicks. These will be explained in the end.

4. Creating tracks for the vehicle

Now we will make the path_track entity we mentioned earlier. I want the vehicle to spawn closer to my player start to that's where I will create the entity:

There are just two values you need to change for this entity. Remember, it will be targeted by the vehicle so set the targetname  value correctly.

This entity will target another path_track entity which defines the point the front of the vehicle will be facing. Set a name and create that one now.

The second path_track must in turn target the first path_track entity. All in all, the first track is where the vehicle spawns, the second track is the direction it will start out facing in-game.

5. Creating vehicle controls

Lastly, we need a way to control the vehicle. Make a trigger brush on the drivers seat or above the vehicle or whatever and make it a func_vehiclecontrols.

Make the vehicle controls target the vehicle and that's it, you have a working car. Compile the level and test the car out in game.

If you have an problem or issue, download the vehicle I've made and see how it works. If you're still stuck, post a comment and I'll try to get back to you.

6. Misc settings

bank
This defines how many degrees the vehicle tilts when cornering. This is good for motorcycles and adds a realistic banking effect.
dmg
Damage dealt to a player who got ran over or crushed by a car. Realistically this should kill the player instantly so set this to something high such as 10000
speed
The speed of the vehicle in units per second. 500 is a good starting value.
startspeed
The velocity of the vehicle as soon as the level loads in-game. The vehicle will immediately decelerate to a stop. This is generally left alone or set to 0.
sounds
The sound of the vehicle. This must be an integer ranging from 1 to 7. You can find the vehicle sounds in cstrike\sound\plats\
volume
The volume of the engine. This must be an integer ranging from 1 to 10, with 10 being the loudest.

Posts

Share

Shareable Image:
Share banner
HTML embed code:
BB embed code:
Markdown embed code:

More embeddable images

Bookmark and Share

Credits

Author
Cd5ssmffan avatar Mapstart Flag
Mapstart
Cd5ssmffan avatar Offline
Mapstart Flag Affiliation: Mapstart
Member Joined 2y
338 points Ranked 12414th

Submitter

Cd5ssmffan avatar
Cd5ssmffan avatar Offline
Mapstart Flag Affiliation: Mapstart
Member Joined 2y
338 points Ranked 12414th

Cd5ssmffan avatar
Cd5ssmffan
Mapstart Flag
Mapstart

Creator
Sign up to access this!
Sign up to access this!
Sign up to access this!
  • Paypal Donate
  • Cd5ssmffan's Bitcoin Wallet
    1CYKwSqCYJeYR7CfdchZHowYnuikiEcpdf
Sign up to access this!

Category

Details

Difficulty Level
Intermediate Difficulty

Attributes

Genre
Mapping

Stats

Posts
4
Views
386
Date Added
27d
Date Modified
27d

Featurings

  • Today's Pick Aug 24 2017

Scores

91 bScore
10 Rating

5 voters

Sign up to access this!

WiPs by Submitter

bcp.crwdcntrl.net tracking pixel