CarCommander

CarCommander 0.2.76

Additional plugin support for RaceTrack
Added chat command /clearcars
Added console command clearcars
Changed water level detection from the driver to the car itself. Any cars driven into water deeper then 75% of the car height will stop and blow up after 5 seconds.
The config has changed! See below for information regarding updating your config

Added permission carcommander.canspawn to allow players to use the spawn chat command
Added config option to use spawnpoint from RandomSpawns for the autospawner

Config Changes (1 line)
C#:
{
  "Button Configuration": {
    "Accelerate": "FORWARD",
    "Brake / Reverse": "BACKWARD",
    "Hand Brake": "SPRINT",
    "Open fuel tank": "FIRE_THIRD",
    "Open inventory": "RELOAD",
    "Toggle lights": "RELOAD",
    "Turn Left": "LEFT",
    "Turn Right": "RIGHT"
  },
  "Fuel Options": {
    "Amount of fuel to give spawned vehicles (maximum)": 50,
    "Amount of fuel to give spawned vehicles (minimum)": 10,
    "Fuel consumption rate (seconds per litre)": 10,
    "Fuel type (item shortname)": "lowgradefuel",
    "Requires fuel": true,
    "Spawn vehicles with fuel": true
  },
  "Inventory Options": {
    "Drop inventory on death": true,
    "Enable inventory system": true,
    "Inventory size (max 36)": 36
  },
  "Movement Settings": {
    "Anti Roll - Front horizontal force": 3500.0,
    "Anti Roll - Rear horizontal force": 3500.0,
    "Anti Roll - Vertical force": 500.0,
    "Engine - Acceleration torque": 600.0,
    "Engine - Brake  torque": 800.0,
    "Engine - Maximum speed": 90.0,
    "Engine - Reverse  torque": 500.0,
    "Steering - Automatically counter steer": false,
    "Steering - Max angle": 60.0,
    "Steering - Max angle at speed": 20.0,
    "Suspension - Damper": 2000.0,
    "Suspension - Distance": 0.2,
    "Suspension - Force": 40000.0,
    "Suspension - Target position (min 0, max 1)": 0.4
  },
  "Passenger Options": {
    "Allow passengers": true,
    "Require passenger to be a clan mate (Clans)": true,
    "Require passenger to be a friend (FriendsAPI)": true
  },
  "Repair Options": {
    "Amount of damage repaired per hit": 30,
    "Amount of item required to repair": 10,
    "Repair system enabled": true,
    "Shortname of item required to repair": "scrap"
  },
  "Spawnable Options": {
    "Enable automatic vehicle spawning": true,
    "Maximum spawned vehicles at any time": 5,
    "Spawnfile name": "",
    "Time between autospawns (seconds)": 1800, // Add this comma 
    "Use RandomSpawns for spawn locations": true // Add this line here
  },
  "UI Options": {
    "Fuel settings": {
      "Background alpha": 0.05,
      "Background color (hex)": "#F2F2F2",
      "Display to player": true,
      "Position - X maximum": 0.83,
      "Position - X minimum": 0.69,
      "Position - Y maximum": 0.096,
      "Position - Y minimum": 0.06,
      "Status alpha": 1.0,
      "Status color (hex)": "#ce422b"
    },
    "Health settings": {
      "Background alpha": 0.05,
      "Background color (hex)": "#F2F2F2",
      "Display to player": true,
      "Position - X maximum": 0.83,
      "Position - X minimum": 0.69,
      "Position - Y maximum": 0.135,
      "Position - Y minimum": 0.1,
      "Status alpha": 0.6,
      "Status color (hex)": "#ce422b"
    }
  }
}
The config has changed! Either delete your config or see below for information regarding updating your config

Fixed bug that would cause dismounting players to move to the terrain
Added a bunch of config options to adjust the cars behaviour (description of all values are on the overview)
Added speed limiter
Added suspension modifiers
Added "roll bars" for vehicle stabilisation
Added steering adjustment based on speed
Added vehicle repair system

Config Changes - Before adding new config entries first remove the entire "Movement Settings" section from your existing config
C#:
{
  "Button Configuration": {
    "Accelerate": "FORWARD",
    "Brake / Reverse": "BACKWARD",
    "Hand Brake": "SPRINT",
    "Open fuel tank": "FIRE_THIRD",
    "Open inventory": "RELOAD",
    "Toggle lights": "RELOAD",
    "Turn Left": "LEFT",
    "Turn Right": "RIGHT"
  },
  "Fuel Options": {
    "Amount of fuel to give spawned vehicles (maximum)": 50,
    "Amount of fuel to give spawned vehicles (minimum)": 10,
    "Fuel consumption rate (seconds per litre)": 10,
    "Fuel type (item shortname)": "lowgradefuel",
    "Requires fuel": true,
    "Spawn vehicles with fuel": true
  },
  "Inventory Options": {
    "Drop inventory on death": true,
    "Enable inventory system": true,
    "Inventory size (max 36)": 36
  },
  "Movement Settings": { // Add from this line
    "Anti Roll - Front horiztonal force": 3500.0,
    "Anti Roll - Rear horiztonal force": 3500.0,
    "Anti Roll - Vertical force": 500.0,
    "Engine - Acceleration torque": 600.0,
    "Engine - Brake  torque": 800.0,
    "Engine - Maximum speed": 90.0,
    "Engine - Reverse  torque": 500.0,
    "Steering - Automatically counter steer": false,
    "Steering - Max angle": 60.0,
    "Steering - Max angle at speed": 20.0,
    "Suspension - Damper": 2000.0,
    "Suspension - Distance": 0.2,
    "Suspension - Force": 40000.0,
    "Suspension - Target position (min 0, max 1)": 0.4
  }, // To this line
  "Passenger Options": {
    "Allow passengers": true,
    "Require passenger to be a clan mate (Clans)": true,
    "Require passenger to be a friend (FriendsAPI)": true
  },
  "Repair Options": { // Add from this line
    "Amount of damage repaired per hit": 30,
    "Amount of item required to repair": 10,
    "Repair system enabled": true,
    "Shortname of item required to repair": "scrap"
  }, // To this line
  "Spawnable Options": {
    "Enable automatic vehicle spawning": true,
    "Maximum spawned vehicles at any time": 5,
    "Spawnfile name": "",
    "Time between autospawns (seconds)": 1800
  },
  "UI Options": {
    "Fuel settings": {
      "Background alpha": 0.05,
      "Background color (hex)": "#F2F2F2",
      "Display to player": true,
      "Position - X maximum": 0.83,
      "Position - X minimum": 0.69,
      "Position - Y maximum": 0.096,
      "Position - Y minimum": 0.06,
      "Status alpha": 1.0,
      "Status color (hex)": "#ce422b"
    },
    "Health settings": {
      "Background alpha": 0.05,
      "Background color (hex)": "#F2F2F2",
      "Display to player": true,
      "Position - X maximum": 0.83,
      "Position - X minimum": 0.69,
      "Position - Y maximum": 0.135,
      "Position - Y minimum": 0.1,
      "Status alpha": 0.6,
      "Status color (hex)": "#ce422b"
    }
  }
}
- Overhauled the vehicle physics. Cars are now much more responsive to drive and with some clever hand braking you can power slide around corners like a boss :p
- Increased bullet damage to vehicles by 200x (now does ~1 damage per bullet as opposed to ~0.005)

** You may want to play around with the config option regarding torque and steering angle to suit your needs
  • Like
Reactions: VinylFresh
Found another component that was destroying chairs when you build next to them and disabled it
Added optional argument "save" to the chat and console commands to force cars spawned via that method to persist through restarts
  • Like
Reactions: john and VinylFresh
The config has changed! See below for more information regarding updating your config

Added light toggle control
Fixed passengers unable to enter once a driver is in the vehicle

I need some volunteers to run debug to help me solve the chair imploding bug

Config Changes (1 line)
C#:
{
  "Button Configuration": {
    "Accelerate": "FORWARD",
    "Brake / Reverse": "BACKWARD",
    "Hand Brake": "SPRINT",
    "Open fuel tank": "FIRE_THIRD",
    "Open inventory": "RELOAD",
    "Toggle lights": "RELOAD", // Add this line here
    "Turn Left": "LEFT",
    "Turn Right": "RIGHT"
  },
  "Fuel Options": {
    "Amount of fuel to give spawned vehicles (maximum)": 50,
    "Amount of fuel to give spawned vehicles (minimum)": 10,
    "Fuel consumption rate (seconds per litre)": 10,
    "Fuel type (item shortname)": "lowgradefuel",
    "Requires fuel": true,
    "Spawn vehicles with fuel": true
  },
  "Inventory Options": {
    "Drop inventory on death": true,
    "Enable inventory system": true,
    "Inventory size (max 36)": 36
  },
  "Movement Settings": {
    "Acceleration torque": 800.0,
    "Brake  torque": 1000.0,
    "Maximum steering angle": 60.0,
    "Reverse  torque": 500.0
  },
  "Passenger Options": {
    "Allow passengers": true,
    "Require passenger to be a clan mate (Clans)": true,
    "Require passenger to be a friend (FriendsAPI)": true
  },
  "Spawnable Options": {
    "Enable automatic vehicle spawning": true,
    "Maximum spawned vehicles at any time": 5,
    "Spawnfile name": "",
    "Time between autospawns (seconds)": 1800
  },
  "UI Options": {
    "Fuel settings": {
      "Background alpha": 0.05,
      "Background color (hex)": "#F2F2F2",
      "Display to player": true,
      "Position - X maximum": 0.83,
      "Position - X minimum": 0.69,
      "Position - Y maximum": 0.096,
      "Position - Y minimum": 0.06,
      "Status alpha": 1.0,
      "Status color (hex)": "#ce422b"
    },
    "Health settings": {
      "Background alpha": 0.05,
      "Background color (hex)": "#F2F2F2",
      "Display to player": true,
      "Position - X maximum": 0.83,
      "Position - X minimum": 0.69,
      "Position - Y maximum": 0.135,
      "Position - Y minimum": 0.1,
      "Status alpha": 0.6,
      "Status color (hex)": "#ce422b"
    }
  }
}
The config has changed! Delete your old config before updating

Added permission required to drive cars spawned by this plugin (carcommander.use)
Added config option to give a random amount of fuel when spawning a car (with minimum and maximum values)
Added config option to adjust the spawn time for the autospawner
Added config options to adjust the UI
Added UI strings to lang file

Fixed cars not always restoring after server restart
Destroy old passenger seats before spawning new ones (when server is not shutdown properly)
Only attach passenger seats of passengers is enabled

The CanMountEntity NRE - I only saw this happen 1 time, all the chairs broke out of the car randomly and upon trying to enter it that error popped up, so I spent a couple of hours trying to reproduce it with no luck. If I had to guess I would say that for what ever reason the chairs are triggering as being in the air causing their destruction but I can't say for certain. I removed the component that manages this from the chairs and hopefully that solves the issue
1 config line has changed! See below for more info

Changed the way fuel is consumed
Added feature where if you driver under water the car will stop, you will be ejected and it will explode after a short delay
Added small delay to restoration to prevent issues when reloading the plugin
Added support for a upcoming plugin

Config Changes
C#:
// Change this 
"Fuel consumption rate (litres per 10 seconds)": 10,
// To this
"Fuel consumption rate (seconds per litre)": 10,
  • Like
Reactions: Pur3x