GithubHelp home page GithubHelp logo

vscript_vehicle's Introduction

VScript Vehicles

Allows prop_vehicle_driveable entities to function in TF2 via VScript. This is not func_vehicle!

Usage

Create a prop_vehicle_driveable entity and set up its model and vehicle script file as usual. In the Entity Scripts section, assign the vehicle.nut script. This script must be assigned to all vehicles. If your vehicle behaves like an Airboat, you will need to set spawnflags to 8 or the physics will glitch out. This can be done by turning off SmartEdit in Hammer.

Finally, create a logic_script and assign it the vehicle_events.nut file. Everything will now work.

NOTE: If using HL2 vehicles such as buggy or airboat, you must add the contents of scripts/game_sounds_vehicle.txt (located in hl2/hl2_misc.vpk) to your maps/<map_name>_level_sounds.txt for sounds to work.

NOTE: vehicle_events.nut setups required event listeners for vehicles and adds a think function to the player. If your map uses scripts with their own events and clears them, or adds a custom think function to the player, you will need to modify vehicle_events.nut for compatibility. The following sources of compatibility need to be considered:

  • If you have ClearGameEventCallbacks in one of your scripts, then remove it from vehicle_events.nut.
  • If you have a think function assigned to players, then remove it from vehicle_events.nut and call Vehicle_FindInCrosshair from your own think function.
  • If you are using OnScriptHook_OnTakeDamage, then remove it from vehicle_events.nut and call Vehicle_OnTakeDamage from your own hook function.

NOTE: Vehicles require sv_turbophysics 0 for player collisions, so this script will automatically set that.

Limitations

The camera will behave weirdly if the player exceeds extreme angles such as flipping upside down. A potential way to resolve this is to assign a point_viewcontrol to the vehicle, but that is out of scope for this project.

Entry/exit animations do not function, but this isn't too much of a big deal.

License

Do whatever the hell you want

vscript_vehicle's People

Contributors

ficool2 avatar

Stargazers

 avatar Denis274 avatar  avatar  avatar Joacoco avatar  avatar

Watchers

 avatar Joacoco avatar

Forkers

pmarkive

vscript_vehicle's Issues

Spectators & Dead players can +use the vehicle, & Ducking perspective issue


spec_kill
dead_kill
Spectators and Dead players can both +use the vehicle and control it.
+use again makes them no longer control the vehicle.



respawn
If the player is still controlling the vehicle once the respawn timer hits zero, they are respawned (or ejected) next to the vehicle rather than at a spawn point, and they are A-posing until they switch weapons.
If they are no longer controlling the vehicle on respawn, then they are spawned normally at a spawn point.



duck_before
duck_after
Also, +duck while in the vehicle breaks your perspective by lowering it until you exit and reenter the vehicle.
-duck does not fix your perspective.


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.