Skip to content

lukashoracek/gmod-selfdriving

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Garry's Mod StarfallEx self-driving script

A StarfallEx script for Garry's Mod, which allows simfphys vehicles to drive themselves under limited conditions when no driver is present using Wiremod.
Speed control is currently simple and will not adjust accordingly to moving objects in the vehicle's path.

Required addons

Usage

It is recommended to use this script on maps which have walls/fences so the vehicle can recognise where to drive and what is a turn.

To use this script:

  1. Spawn a simfphys vehicle.
  2. Place three WireMod rangers with default settings and max distance set at least to 1000 (1500 is recommended, you can type it in) and default to zero disabled, on the vehicle:
  • one looking in front of the vehicle
  • one looking around 30° - 45° to the left
  • one looking around 30° - 45° to the right
  1. Place a speedometer on the vehicle
  2. Place a StarfallEx chip on the vehicle and copy the script into the chip.
  3. Connect the WireMod inputs and outputs of the chip accordingly using Wiring tool under Wiremod tab in the spawn menu.
    Front, Left, Right should be connected to rangers' distance outputs accordingly.
    Speed should be connected to speedometer's Out output
  4. Every player with StarfallEx should now be able to use this script's keybinds

Keybinds

  • L - toggle pullover mode
  • I - go straight
  • O - find a left turn and turn there
  • P - find a right turn and turn there

License

Copyright (c) 2020-2021 Lukáš Horáček

Licensed under the GNU General Public License v3.0.