Autodrive

by Pi-C

Car equipment for train avoidance, logistic network integration, circuit network connectivity, fuel refill, ammo reload, radio control, enemy targeting, and gate control.

a month ago
0.17 - 1.1
8261

Changelog

Version: 1.1.2
Date: 2022-06-16
  Uploaded by:
    - Pi-C

  Bugfixes:
    - Fixed crash when trying to render a path for a destroyed vehicle. (https://mods.factorio.com/mod/autodrive/discussion/62b75fcae07b54516be76873?quote=0)

  Changes:
    - Removed obsolete version checks for filtering events. Filtering script-raised events has been possible since 0.18.27! :-)

  TODO:
    - Reorganize code so it's easier to maintain. After that, there may be time to get to the rest of this list.
    - Mod should be usable with spidertrons as well.
    - Add filters to ignore creatively used prototypes from mods.
    - React to on_forces_merged and on_player_changed_force
    - Adjust speed in autodrive mode according to max speed of vehicle prototype on given terrain. Accelerating works already (not yet implemented), but getting the braking right is hard!

    - Bugfix: Suicide by train -- quite a nuisance, but I first need to be more familiar with the code before tackling this.
    - Change: Enter panic mode (accelerate) if vehicle is unarmed and has enemy sensor and enemies are in range.
    - Change: Find a way to toggle logistics behavior so that items requested/loaded in place A can be provided/unloaded in place B. (Buffer chest instead of requester/provider?)
    - Potential change: Does limiting speed of aircraft make sense? Should they be excluded from checking for trains? Could be a problem with parked/landing/starting aircraft close to a railway!
    - Eye candy: Allow vehicles to be named in the GUI, so it's easier to distinguish between different vehicles of the same kind.
    - Potential change: Add drop-down list of destinations?
    - If the current fuel is *requested in a slot*, fuel tank will be filled up first (also for weapons)
    - Add repair sensor (https://mods.factorio.com/mod/autodrive/discussion/5f0bb638aaa96f7748e87d86)
Version: 1.1.1
Date: 2022-06-16
  Uploaded by:
    - Pi-C

  Bugfixes:
    - Fixed crash on loading a vehicle owned in Autodrive to a Vehicle Wagon when GCKI was not active. (https://mods.factorio.com/mod/autodrive/discussion/62ab083ad7aebf180542168c)
Version: 1.1.0
Date: 2022-05-03
  Uploaded by:
    - Pi-C

  Info:
    - This is a long overdue update to Factorio 1.1. I didn't have time yet to restructure the mod, so it's basically the same mod as before, with hardly any changes worth mentioning. I won't have a lot of time to work on this in the near future, so I won't update this in the near future. (Considering that the control script is just one big monolithic block of code, it's no fun to maintain this.) However, I've already taken precautions that it will be compatible with the pending version of GCKI.

  Bugfixes:
    - Fixed that the Beam weapon of AAI Wardens was replaced with a vehicle machine gun. (https://mods.factorio.com/mod/autodrive/discussion/5ffaf3cbe65e1f69e7249c46)

  Changes:
    - Replaced hard dependency on "Shortwave" with an optional dependency on "Shortwave for 1.1". If that mod isn't available, the circuit-network sensor won't be created. (https://mods.factorio.com/mod/autodrive/discussion/5ef93c26936a68d808cd68aa)
Version: 0.2.10
Date: 2020-08-23
  Uploaded by:
    - Pi-C

  Info:
    - All changes are also available for Factorio 0.17 (version 0.1.30 of this mod).

  Bugfixes:
    - Fixed that players would be nagged to install GCKI even if an appropriate version was already active. Seems the version check disappeared from on_player_joined_game when I tried including it directly in the nagging function but removed it from there later on.
Version: 0.2.9
Date: 2020-08-17
  Uploaded by:
    - Pi-C

  Info:
    - All changes are also available for Factorio 0.17 (version 0.1.29 of this mod).

  Bugfixes:
    - Fixed instant desync when clients tried to join a multiplayer game. (https://mods.factorio.com/mod/autodrive/discussion/5f37e3c043e182003c399eb6)

  Changes:
    - Fixed that it was possible to select or stop a vehicle that was already controlled by another player. Now, you can only manipulate vehicles for which your name or no name is displayed in the GUI.
    - If a vehicle has been marked as selected by Autodrive, this will be visible to all players, including those from another force.
Version: 0.2.8
Date: 2020-08-15
  Uploaded by:
    - Pi-C

  Info:
    - All changes are also available for Factorio 0.17 (version 0.1.28 of this mod).
    - Unless there are any serious bugs, this will be the last version of this mod for Factorio 0.18.

  Bugfixes:
    - Fixed crash on loading a saved game when a mod providing vehicles has been removed. (https://mods.factorio.com/mod/autodrive/discussion/5f37e3c043e182003c399eb6)

  Changes:
    - I've been convinced that the nagging messages recommending to install GCKI may be too intrusive even though they've been shown just once per session. As Autodrive and GCKI both have a lot of code supporting each other, and as adding a dependency on GCKI to Autodrive isn't possible, I still think it's legit to point players to GCKI -- but I totally understand that you don't want to see this message each time you reload after dying. So starting with this release, the message will be shown at most 3 times per game: once when a new game is created or Autodrive is added to an existing game, and two more times when on_configuration_changed is triggered (new Factorio version, added/removed/updated mods, or changed settings).     (https://mods.factorio.com/mod/autodrive/discussion/5ec33483972846000e2df115)

    - It's stupid that you get the GUI toggle button right from the start of the game, when you don't have even a car yet that could be controlled with it. From now on, the GUI toggle button won't be shown until the Car radio control has been researched by you or your force.
Version: 0.2.7
Date: 2020-06-03
  Uploaded by:
    - Pi-C

  Info:
    - All changes are also available for Factorio 0.17 (version 0.1.27 of this mod).

  Bugfixes:
    - Fixed dependencies: "Unminable Vehicles" must be loaded before this mod; that's not necessary for "Vehicle Wagons 2".
    - Fixed crash on loading a saved game in Factorio <0.18.27 by including code to avoid calling script raised events with filtering. (https://mods.factorio.com/mod/autodrive/discussion/5ed1c874bf1de3000b182448)
    - Fixed crash when remote calls were issued to GCKI, but GCKI was not installed. (https://mods.factorio.com/mod/autodrive/discussion/5ed65b14c8ae2b000b765992)
    - Fixed that follow-player proximity setting wasn't cached.
    - Fixed crash of Factorio 0.17.79 and 0.18.<27 when script_raised_built was called with created_entity instead of entity. (https://mods.factorio.com/mod/autodrive/discussion/5ed6ab7d459dda000c60c90d)

  Gui:
    - Added some checks so that the text of tooltips better reflects the state of a vehicle.
    - Show the name of the player that a vehicle is following; if it's not in follow mode, the name of the player who selected it will be used instead.
    - Follow button is not active if a vehicle already follows another player.

  Changes:
    - Unlock locked vehicles that have been left behind if GCKI was removed from the game.
    - A vehicle that's already on the GUI can't be selected by another player if it is in follow mode.
    - Update vehicle list and GUI when a player is permanently removed from the game.
    - Added migration script to store mod settings in global table.

  Minor Features:
    - Added startup settings to disable healing of vehicles when they hit a tree and healing of friendly entities when a vehicle collides with them.
Version: 0.2.6
Date: 2020-05-30
  Uploaded by:
    - Pi-C

  Info:
    - All changes are also available for Factorio 0.17 (version 0.1.26 of this mod).

  Features:
    - If the Fuel Sensor is installed in a vehicle, and if that vehicle has a grid where equipment like the "Portable generator"/"Small portable generator" from "Krastorio 2" is installed, and if there is any fuel in the vehicle's trunk that can be used with these generators, they now will also be refueled. Refueling the vehicle takes precedence, however.
    - "Allow requests from buffer chests" is no longer a runtime player setting. It has been moved to the GUI, so you can change this separately for each vehicle.

  Changes:
    - Added compatibility with "Vehicle Wagons 2": If a vehicle controlled by Autodrive is loaded onto a vehicle wagon, it will be removed from the GUI until it has been unloaded. Thanks to robot256 for cooperating on making our mods compatible!

    - Unloading a vehicle from a vehicle wagon will not select it -- you'll have to do this with the remote control or the GUI!
    - Vehicles locked or claimed with GCKI can only be selected be the player who claimed or locked them.


  Bugfixes:
    - Logicarts shouldn't be controlled by Autodrive, so adding Autodrive sensors to its grid doesn't make sense. Blacklisted grids from Logicarts.
    - Fixed that GUI was still updated on every tick. This should boost performance immensely! (https://mods.factorio.com/mod/autodrive/discussion/5daacebcf6f1ad002bf2afb5)
    - Fixed an ancient bug where a test checked for the wrong condition when accelerating or braking. It went unnoticed because the condition would always be true, so vehicles would accelerate/brake as expected.

  Modding:
    - Other mods can now blacklist their grids, so Autodrive won't extend them and won't place its sensors into these grids.

    - Added remote interfaces for "Vehicle Wagons 2" and similar mods that may remove vehicles for a while and restore them later.

      USAGE:

      remote.call("autodrive", "get_vehicle_data", vehicle)

        This will return a table with the vehicle data. Currently it only contains { owner = player.index or nil}, but it may be extended in the future.

        vehicle: entity.unit_number or a valid (!) entity of type "car"

      remote.call("autodrive", "vehicle_removed", vehicle, modname)

        This will return nothing. If a vehicle was controlled by Autodrive, it will be removed from the GUI.

          vehicle_id: entity.unit_number or a valid entity of type "car"
Version: 0.2.5
Date: 2020-05-08
  Uploaded by:
    - Pi-C

  Info:
    - All changes are also available for Factorio 0.17 (version 0.1.25 of this mod).

  Bugfixes:
    - Fixed crash when logistic operations should be performed on a vehicle not associated with a player. (https://mods.factorio.com/mod/autodrive/discussion/5eb47628de651c000d0a0026)
Version: 0.2.4
Date: 2020-05-07
  Uploaded by:
    - Pi-C

  Info:
    - All changes are also available for Factorio 0.17 (version 0.1.24 of this mod).

  Bugfixes:

  Minor Features:
    - Vehicles equipped with a Logistic network sensor can now also request items from buffer chests. This is a per-user setting. (https://mods.factorio.com/mod/autodrive/discussion/5eb40158de651c000dfee8ce)

  Changes:
    - Removed code introduced in 0.1.8 and 0.1.10 that added compatibility with the grids from  Bob's/Angel's and Krastorio. It's obsolete since 0.1.23/0.2.3 as this mod is handling grids on it's own now.
Version: 0.2.3
Date: 2020-05-01
  Uploaded by:
    - Pi-C

  Info:
    - All changes are also available for Factorio 0.17 (version 0.1.23 of this mod).

  Bugfixes:
    - Fixed crash when starting an in-game tutorial.

  Changes:
    - Optimized a regular expression for string matching. Thanks a lot to Oktokolo!
Version: 0.2.2
Date: 2020-04-29
  Uploaded by:
    - Pi-C

  Info:
    - dorfl has transferred ownership of this mod to me (Pi-C).
    - All changes are also available for Factorio 0.17 (version 0.1.22 of this mod).

  Bugfixes:
    - Fixed crash related to some apparent change to LuaPlayer.shooting_state in Factorio 0.18.19.
      (https://mods.factorio.com/mod/autodrive/discussion/5e9e1a649e85eb000d0617ba)
    - Removed "Automobilism" from prerequisites of "Circuit network sensor" and "Gate sensor". It was redundant because their prerequisite technology "Car radio control" already requires "Automobilism".
    - Fixed that the GUI was spammed with buttons for vehicles that didn't exist anymore because they had been replaced by "AAI Programming Vehicles".

  Locale:
    - Added Russian localization. Thanks a lot to Dragonling for providing it!

  Features:
    - A minimal equipment grid just big enough to fit all sensors in it will be added to vehicles that don't have an equipment grid yet. However, only sensors from "Autodrive" can be placed into this grid, so if you want to add more equipment to your vehicles, you still need to install another mod providing grids!
    - VortiK's "Armor Plating" adds small grids to vehicles, but they are too small to fit in armor and all of the "Autodrive" sensors. Therefore, if "Armor Plating" is active, its grids will be extended.
    - The size of grids from all other mods (e.g. "Vehicle Grid") will not be changed. However, these grids will be adjusted so that you can place the "Autodrive" sensors from this mod in them.
Version: 0.2.1
Date: 2020-03-18
  Uploaded by:
    - Pi-C

  Changes:
  Bugfixes:
    - Fixed crash when vehicle color should be set to the owner's color but there was no owner yet. (Don't know how that could happen in the first place. I couldn't reliably reproduce it, but it has crashed my game.)
Version: 0.2.0
Date: 2020-01-24
  Uploaded by:
    - Pi-C

  Info:
    - Upgraded for Factorio 0.18 (no code changes)
Version: 0.1.21
Date: 2019-12-27
  Uploaded by:
    - Pi-C

  Bugfixes:
    - Fixed that "Follow player" switch in the GUI wouldn't work by enforcing that the GUI is rebuilt if configuration changes (added/removed mods or changed mod settings), if a player joins the game, or if a singleplayer game is loaded.

  Changes:
    - Output message recommending to install GCKI if it's not active, or to update it to a version >=0.17.14 if a previous version is installed. Adding a dependency won't work (circular dependency error) because GCKI must depend on Autodrive (patches fixing issues with Autodrive are implemented there now and have been disabled in GCKI).

  Gui:
    - Added button to disconnect a vehicle from Autodrive and remove it from the GUI. If the vehicle is moving when you disconnect it, it will brake hard. Disconnecting a vehicle from Autodrive will trigger an alert, so you can easily find it on the map.
    - Added indicator if vehicle is not active. If GCKI >=0.17.14 is active and the vehicle has been locked with the keys from GCKI, a special indicator will be used.
    - If a vehicle is not active, the controls "Select", "Stop", and "Follow" will be disabled.
Version: 0.1.20
Date: 2019-12-21
  Uploaded by:
    - Pi-C

  Changes:
    - Improved bouncing:
      - Code optimization
      - Vehicles bumping into something while moving backwards will now really bounce into the opposite direction.
      - Vehicles will not bounce off trees if they kill them on first impact. This means that a lightweight car will probably bounce back when it collides with a tree while a tank will be able to proceed. May be a nerf, but it's not plausible that a light car should do the same damage as a heavy tank.

  Bugfixes:
    - Removed unnecessary event listener (the function it called was never defined).

  Locale:
    - Localized messages
Version: 0.1.19
Date: 2019-12-20
  Uploaded by:
    - Pi-C

  Bugfixes:
    - Ooops, didn't remove all debugging output! There was one line left that wrote to the log file on every tick -- sorry!
Version: 0.1.18
Date: 2019-12-20
  Uploaded by:
    - Pi-C

  Info:
    - I (Pi-C) have been added as collaborator on this mod.

  Changes:
    - Ignore vehicles that are not active, for example cars that have been locked with the keys from "Gizmos Car Keys (improved)".
    - Ammo sensor and Enemy sensor worked before, but only for vehicles that have only one weapon. Tanks can have 3, but reloading didn't always work (if first weapon had no ammo, it couldn't shoot, but if one of the other weapons had ammo it wouldn't reload the first). Now, the mod tries to reload all available weapons, and tries to switch over to the next weapon if it can't reload the current one.
    - If your vehicle has an Enemy sensor, and if that vehicle runs out of ammo and can't reload, it will now behave as if it had no Enemy sensor.
    - Different people complained that their vehicles would bounce back if they collided with a tree. You will now be able to plow through the thickest forest with your tank or even your car.

  Bugfixes:
    - If a vehicle controlled by this mod was destroyed, it would leave a dummy passenger behind. This dummy is now removed.
    - If a vehicle controlled by this mod had both a human driver and a human passenger, it would continue shooting at the last target position until it ran out of ammo. It will now cease shooting as soon as the last enemy or spawner in its range has been destroyed.
Version: 0.1.17
Date: 2019-08-07
  Uploaded by:
    - dorfl

  Bugfixes:
    - work around bobs logistics changes to logistics chest prototypes
Version: 0.1.16
Date: 2019-08-07
  Uploaded by:
    - dorfl

  Changes:
    - check player on same surface before pathing (follow sensor)
Version: 0.1.15
Date: 2019-08-19
  Uploaded by:
    - dorfl

  Bugfixes:
    - use correct car sprite in the GUI. This caused a crash for, eg, Angel's CAB
Version: 0.1.14
Date: 2019-08-18
  Uploaded by:
    - dorfl

  Changes:
    - add 'Follow player' sensor and tech
Version: 0.1.13
Date: 2019-08-18
  Uploaded by:
    - dorfl

  Bugfixes:
    - fix notfication crash when failing to find non-colliding-position at path target
Version: 0.1.12
Date: 2019-08-17
  Uploaded by:
    - dorfl

  Bugfixes:
    - avoid invalid entity reference trying to unpublish non-published car in GUI
Version: 0.1.11
Date: 2019-08-17
  Uploaded by:
    - dorfl

  Changes:
    - GUI car list
    - multiplayer car selection fixes
Version: 0.1.10
Date: 2019-08-16
  Uploaded by:
    - dorfl

  Bugfixes:
    - catch nil prototype collision_mask for helicopter
  Changes:
    - add sensors to 'vehicle-equipment' for Krastorio
    - trigger logistics sensor when trunk not yet filtered, for emptying
Version: 0.1.9
Date: 2019-08-12
  Uploaded by:
    - dorfl

  Bugfixes:
    - keep item-with-{tags,label,inventory,entity-data} intact during logistics transfer
  Changes:
    - spread UPS load over multiple ticks for scanning large vehicle inventories (Hauler, Crawler)
Version: 0.1.8
Date: 2019-08-11
  Uploaded by:
    - dorfl

  Changes:
    - add sensors to 'vehicle' category for Bob's
    - add sensors to 'angels-crawler' category for Angel's Crawler
Version: 0.1.7
Date: 2019-08-10
  Uploaded by:
    - dorfl

  Changes:
    - reduce UPS load for train sensor when car is parked and not on rails
    - cars with circuit sensors report status via signals on their shortwave channel
  Bugfixes:
    - recovery code for cars that lock together during bounce-crash
Version: 0.1.6
Date: 2019-08-09
  Uploaded by:
    - dorfl

  Changes:
    - render path segments incrementally over multiple ticks to avoid latency spike for long paths
Version: 0.1.5
Date: 2019-08-09
  Uploaded by:
    - dorfl

  Bugfixes:
    - car channel now persists subsqeuent selections
Version: 0.1.4
Date: 2019-08-09
  Uploaded by:
    - dorfl

  Changes:
    - dispatch car via circuit network sensor (with shortwave dependency)
Version: 0.1.3
Date: 2019-08-06
  Uploaded by:
    - dorfl

  Changes:
    - render path destination circle as visual feedback after click
    - relax click bounds detection
Version: 0.1.2
Date: 2019-08-06
  Uploaded by:
    - dorfl

  Changes:
    - Move gate sensor behind gates research
    - Move train sensor behind rail-signals research
    - Added military dependency for ammo and enemy sensors
    - Drop adavanced-electronics dependencies (cover by other deps for logistic sensor)