Autodrive

by Pi-C

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

Content
12 days ago
0.17 - 2.0
3.32K
Transportation Combat Logistic network Circuit network

b [Fixed?] Latest version is broken?

2 months ago

Failed to load mods: Error while loading recipe prototype "yeet-item-with-entity-data-AD+GCKI-dummy-item_omnicar-item-vehicle-machine-gun" (recipe): Invalid prototype name. Only characters A-Z a-z 0-9 _- are allowed.
Modifications: ○🌐Planet Rubia

Interferes with Rubia, Happy's Omnicar, Gunboats...

2 months ago
(updated 2 months ago)

The file that creates the dummy items hasn't been touched since I first introduced it (version 1.1.4, January 2023). At that time, prototype names could contain any character except dots (see here). With Factorio 2.0 that has changed: only alphanumeric characters, dashes and underscores are legal characters now.

If you could use Autodrive with Factorio 2.0 before, you probably have added a mod that caused Autodrive to run the code creating the dummy entities. What other mods do you use? I'd like to check whether the mod in question does anything else that could cause problems. :-)

By the way, you can fix the immediate crash by unpacking autodrive_2.0.4.zip and changing line 32 of file prototypes/3-recreate-car-items.lua:

      new_item.name = "AD+GCKI-dummy-item_"..new_item.name

Just remove the plus sign, then your game should start again. :-)

2 months ago

"what other mods do I use" 😅like 400 I wouldn't be surprised if a lot of them triggered this routine.

I'm not sure if I used this specific mod before though, but it is a fresh install. I'll use that fix then, thank you!

a month ago

had the same error with cargo ships
Failed to load mods: Error while loading item prototype "AD+GCKI-dummy-item_boat-0" (item-with-entity-data): Invalid prototype name. Only characters A-Z a-z 0-9 _- are allowed.
Modifications: Autodrive

replaced line 32 with
new_item.name = "ADGCKI-dummy-item_"..new_item.name

and got this error

Failed to load mods: Error while loading item prototype "ADGCKI-dummy-item_boat-0" (item-with-entity-data): Unknown flag "hidden"
Modifications: Autodrive

a month ago

i disabled Auto drive and Gizmo car keys gave me the same error
then i disabled AAI Programmable Vehicles and it worked with AD+GCK

a month ago

Failed to load mods: Error while loading item prototype "ADGCKI-dummy-item_boat-0" (item-with-entity-data): Unknown flag "hidden"

Thanks for the report! Yes, one of the changes in Factorio 2.0 was that hidden is now a property of the prototype, not a flag. I've already fixed this in my WIP version by changing line 34 in file prototypes/3-recreate-car-items.lua with the following:

      new_item.hidden = true             
      new_item.hidden_in_factoriopedia = true

i disabled Auto drive and Gizmo car keys gave me the same error
then i disabled AAI Programmable Vehicles and it worked with AD+GCK

I'll have to look at what AAI Programmable Vehicles does …

12 days ago

Please try version 2.0.5!

12 days ago

Now I'm getting this error when attempting to load my save:

Error while running event autodrive::on_init()
autodrive/vehicle_lists.lua:1029: bad argument #1 of 2 to 'pairs' (table expected, got nil)
stack traceback:
[C]: in function 'pairs'
autodrive/vehicle_lists.lua:1029: in function 'get_vehicle_prototypes_map'
autodrive/scripts/event_handlers.lua:792: in function 'on_init'
autodrive/control.lua:393: in function <autodrive/control.lua:393>

12 days ago

Thanks for the report! I wonder why there are no ammo_items stored for the vehicle prototype. Unfortunately, the mod still has no setting to enable debugging. A saved game probably wouldn't help much either because the interesting stuff seems to happen in mods requiring SA (which I don't have). So I need a bit help!

Please add this right before line 1029 of file vehicle_lists.lua:

log(string.format("ammo_items stored for gun %s (%s): %s",
    g, gun.name, serpent.block(mod.prototypes.items.guns[gun.name].ammo_items)))

and this right before line 1026 (same file):

log(string.format("Vehicle: %s (%s)", p_name, proto_type))

Then clear factorio-current.log, reload your saved game and upload factorio-current.log where I can fetch it without having an account (I'm not on Google etc.). If you're on the forum, you could also send me a private message with the log attached.

9 days ago

thank you for your patience - here's the log you requested:

https://hurtzcloud.xyz/s/XfsiQgg432a9jxS

(this is my private cloud - if you'd rather I use a more conventional file host, let me know)

(as well, let me know if you need help reproducing any other SA-specific issue, I'd be glad to help :) )

9 days ago

Thanks, got the log! The error occurs with King Jo's Bulldozer, which has a dummy gun that doesn't use any ammo. Instead of shooting, the bulldozer gets a speed boost when driver or passenger "shoot" the gun by hitting the SPACE key.

I'll have to think about how to deal with gun-item prototypes that don't use ammo. Ignoring all such guns seems risky because other mods may introduce guns which consume no ammo but can still hurt enemies.

Meanwhile, you can fix the crash by changing line 1029 of file vehicle_lists.lua from

        for a_name, a in pairs(mod.prototypes.items.guns[gun.name].ammo_items) do

to

        for a_name, a in pairs(mod.prototypes.items.guns[gun.name].ammo_items or AD.EMPTY_TAB) do
8 days ago

Honestly?

I'm just gonna disable the bulldozer - not the first time King Jo's mods cause issues (for example if you want some fun - install any airplane mod that adds bombs, and an infinite ammo mod...)

Thanks for looking into it for me!

New response