Git Product home page Git Product logo

source-vehicles's Introduction

Driveable Vehicles for Source Engine Multiplayer

This is a SourceMod plugin that allows spawning driveable vehicles based on prop_vehicle_driveable in Source engine multiplayer games.

List of supported games:

  • Team Fortress 2
  • Counter-Strike: Source
  • Black Mesa

While this has been done before, the implementation of this plugin is vastly different. Instead of simulating user input on the vehicle through the entity inputs, it forwards your user input directly to the vehicle, making driving feel incredibly smooth.

This plugin bundles the required entity fixes, and a few configurable nice-to-have features.

Features

  • Fully functioning driveable vehicles based on prop_vehicle_driveable
  • Vehicle sounds
  • Entry and exit animations (experimental)
  • Physics collisions and damage against other players
  • High customizability through plugin configuration and ConVars

Dependencies

Installation

  1. Download the latest version from the releases page
  2. Extract the contents of the ZIP file into your server's game directory
  3. Restart your server or type sm plugins load vehicles into your server console

Usage

There is a menu combining all the plugin's features that can be accessed using sm_vehicle.

Additionally, you may use sm_createvehicle to create and sm_removevehicle to remove a vehicle. To remove all vehicles in the map, use sm_removeallvehicles.

To enter a vehicle, look at it and use the +use console command.

Configuration

The vehicle configuration allows you to add custom vehicles. Each vehicle requires at least a name, model, vehicle script, and vehicle type. More documentation and examples can be found in the default configuration.

To learn how to create custom vehicle models and scripts, check out the Vehicle Scripts for Source guide on Steam.

Example Configuration

"Vehicles"
{
	"0"
	{
		"id"					"example_vehicle"
		"name"					"#Vehicle_ExampleVehicle"
		"model"					"models/vehicles/example_vehicle.mdl"
		"script"				"scripts/vehicles/example_vehicle.txt"
		"type"					"car_wheels"
		"soundscript"				"scripts/example_soundscript.txt"
		"skins"					"0,1,2"
		"key_hint"				"#Hint_VehicleKeys_Car"
		"lock_speed"				"10.0"
		"is_passenger_visible"			"1"
		"horn_sound"				"sounds/vehicles/example_horn.wav"
		"downloads"
		{
			"0"	"models/vehicles/example_vehicle.dx80.vtx"
			"1"	"models/vehicles/example_vehicle.dx90.vtx"
			"2"	"models/vehicles/example_vehicle.mdl"
			"3"	"models/vehicles/example_vehicle.phy"
			"4"	"models/vehicles/example_vehicle.sw.vtx"
			"5"	"models/vehicles/example_vehicle.vvd"
			"6"	"materials/models/vehicles/example_vehicle.vmt"
			"7"	"materials/models/vehicles/example_vehicle.vtf"
		}
	}
}

ConVars

The plugin creates the following console variables:

  • vehicle_config_path ( def. "configs/vehicles/vehicles.cfg" ) - Path to vehicle configuration file, relative to the SourceMod folder
  • vehicle_physics_damage_modifier ( def. "1.0" ) - Modifier of impact-based physics damage against other players
  • vehicle_passenger_damage_modifier ( def. "1.0" ) - Modifier of damage dealt to vehicle passengers
  • vehicle_enable_entry_exit_anims ( def. "0" ) - If set to 1, enables entry and exit animations (experimental)
  • vehicle_enable_horns ( def. "1" ) - If set to 1, enables vehicle horns

Physics Damage

This plugin will automatically enable physics collisions and damage to allow vehicles to collide with other players.

If you intend to use these vehicles in a friendly environment without any combat aspects, set sv_turbophysics to 1. It will allow vehicles to pass through other players.

Entry and Exit Animations

Most vehicles have entry and exit animations that make the player transition between the vehicle and the entry/exit points. The plugin fully supports these animations.

However, since Valve never intended prop_vehicle_driveable to be used outside Half-Life 2, there is code that does not function properly in a multiplayer environment and can even cause client crashes.

Because of that, entry and exit animations on all vehicles are disabled by default and have to be manually enabled by setting vehicle_enable_entry_exit_anims to 1. If you intend to use this plugin on a public server, it is highly recommended to keep the animations disabled.

source-vehicles's People

Contributors

mikusch avatar batfoxkid avatar blueberryy avatar jagflax avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.