An entity introduced to Counter-Strike back in 2000, and recently in Half-Life in 2023 for its 25th anniversary. Combined with
func_vehiclecontrols
, it creates a player-controlled driveable vehicle. Quite buggy, but it serves its purpose if set up right.
As mentioned above, this entity was added in the 25th anniversary update from November 2023.
This means that this entity will not spawn if the map is running in an older version of Half-Life (a warning in the console will be shown) or a mod based on the old Half-Life SDK.
Attributes
- Name (targetname) - Property used to identify entities.
- Render FX (renderfx) - Gives objects special render effects. Think of it as modifying whatever the Render Mode puts out. The options are as follows:
- 0 = Normal
- 1 = Slow Pulse
- 2 = Fast Pulse
- 3 = Slow Wide Pulse
- 4 = Fast Wide Pulse
- 5 = Slow Fade Away
- 6 = Fast Fade Away
- 7 = Slow Become Solid
- 8 = Fast Become Solid
- 9 = Slow Strobe
- 10 = Fast Strobe
- 11 = Faster Strobe
- 12 = Slow Flicker
- 13 = Fast Flicker
- 14 = Constant Glow
- 15 = Distort
- 16 = Hologram (Distort and Fade)
- Render Mode (rendermode) - Controls the type of rendering that is used for an object. Options are:
- 0 = Normal
- 1 = Color
- 2 = Texture
- 3 = Glow
- 4 = Solid
- 5 = Additive
- FX Amount (renderamt) - If Render Mode is not set to Normal, this defines how transparent the object is (0 - invisible; 255 - fully visible)
- FX Color (rendercolor) - If Render Mode is set to Color - this defines in what color the object will be filled.
- First Stop Target (target) - Name of the
path_track
used to align the vehicle (consult tutorial).
- Sound (sounds) - Choose from a list of sounds for your vehicle to emit when moving/idle:
- 0 = None
- 1 = Car 1
- 2 = Car 2
- 3 = Truck 1
- 4 = Truck 2
- 5 = Boat 1
- 6 = Boat 2
- Length of the vehicle (length) - Length of your vehicle. Controls handling (the longer the car - the harder to steer)
- Width of the vehicle (width) - Width of your vehicle. Controls X Axis tilt when making turns.
- Height above track (height) - Defines where the vehicle will collide with ground (0 = at center of origin brush)
- Initial speed (startspeed) - Vehicle starts moving at this speed.
- Speed (speed) - Maximum speed (0-2000; 2000 is the global speed limit in the game)
- Acceleration (integer) - How fast the vehicle accelerates in no defined unit (1-10)
- Damage on crush (dmg) - If the player or any damageable entity is caught between the vehicle and a solid brush, this is the amount of damage it will sustain.
- Volume (volume) - Defines how loud the vehicle sounds will be (0-10)
- Bank angle on turns (bank) - This is the angle the vehicle will tilt when cornering.
- Minimum Light Level (_minlight)
Flags
- No Pitch(X-Rot) (1) - [misnamed] Vehicle will not tilt when cornering. It still pitches up/down slopes.
- No User Control (2) - Players will not be allowed to control the vehicle.
- Passable (8) - Makes object non-solid.
Notes
- Just like a
func_tracktrain
, a func_vehicle
needs an origin brush.
- Also like
func_tracktrain
, the brushwork for a func_vehicle
must be built in the map editor facing "West" (-X axis, or (← )
on the Yaw compass).
- Also also like
func_tracktrain
, func_vehiclecontrols
is used to define the area where the player has to be on the vehicle to be able to control it. Simply place the brush relative to the vehicle in the map. If omitted, defaults to the bounding box at some height above the vehicle's origin, also also also like func_tracktrain
.
- On spawn, the
func_vehicle
is moved to its first path_track
(First Stop Target), facing the second path_track
. You can also leave "First Stop Target" blank and simply use the Yaw compass to rotate the vehicle around its origin at spawn, and since the vehicle is facing the other way of the Yaw compass, point it to where you want the back of the vehicle to face. However the vehicle must be placed in its final position (e.g. with wheels firmly touching the ground) for this, otherwise the vehicle will float over the ground until it's driven up or down a slope.
- Having the origin at zero height tends to get the vehicle swallowed into the ground on upward slopes. Raise it up to, say, around the level of the axles, and set the height value appropriately.
- Vehicle sound is currently bugged in Half-Life.
- Triggering a named stationary
func_vehicle
gives it a forward jolt, proportional to the set speed. If the vehicle is moving, it is stopped dead. Sending an ON state using trigger_relay
also gives a jolt but only when stationary. Likewise an OFF signal stops it.
- The vehicle has a fixed deceleration of 20 units every 0.1s (therefore 200u/s/s).
- Reverse speed is capped to 35% of forward speed.
- You can remote control a
func_vehicle
with game_counter_set
. You need to trigger this every 0.1s for a constant throttle, otherwise the vehicle would quickly decelerate. The values to use are:
- +1 throttles forward
- -1 throttles in reverse
- +20 turns left
- +30 turns right
- 0 stop immediately
- To create an invisible vehicle barrier, use NULL brushes tied to
func_detail
with its Passable property set to "Yes". You might need to lift the brushes off the ground (i.e. not touching it.)
- [CS] The only official maps to use
func_vehicle
were de_jeepathon2k, which was only included in beta 7.0 and beta 7.1, and cs_siege. A drivable vehicle was added to Siege in beta 7.1, but was removed in a later version.
- Examples of custom maps with func_vehicle: de_racetownz with cars, air_fight2 with helicopters, and cc_boathouse with boats.
- Tayl0r at Counter-Map has written a tutorial.