Vehicle Equipment Grids

by Kryzeth

Adds equipment grids to vehicles in a sensible manner (no more exoskeleton legs in cars or trains or boats or planes), and adds a replacement vehicle specific speed booster equipment. Compatible with SE Space Trains, Fusion Trains, Flamethrower Wagon, Aircraft, AAI Vehicles, Cargo Ships, GunEquipment, Radar Equipment (and more!)

Tweaks
15 days ago
1.1 - 2.0
2.79K
Transportation Trains

i [Half-Implemented] Logistics system integration?

a month ago

Vehicles with grids are honestly quite awesome, but they lack one of the most useful functions of the player's own grid - the ability to make automated requests to the Logistics system. Is there any way to integrate that into this mod? That would make vehicle grids fully comparable to player grids.

a month ago
(updated a month ago)

It would be nice if the cargo wagons and other vehicles could make logistic requests, but as far as I can tell, there's no way to do that during the loading phase. The features of each basic prototype (like "cargo-wagon") can't really be modified to add features from other prototypes (like logistics tab) in that way.

It might be possible to implement this functionality using some kind of runtime code, but I'm not well-versed at working with runtime modding (basically anything that happens during control.lua), and I would have no idea where to even begin.

a month ago

Got it. Yeah, logistics requests for vehicles would probably be runtime scripts, so fair enough there. Thanks for having a look.

a month ago

Actually, I looked into a bit further. It turned out to be dirt simple. There's a hardcoded global variable which determines whether car-type vehicles have logistics grids. Any vehicle with logistics trash slots will have logistics enabled for it. Trash slots are 0 by default, and the car just doesn't have that definition (it's a nil value). Giving it 20 slots (same as the Tank and Spidertron) enables logistics for the car when the tech is researched. I actually threw together a simple mod for it: https://mods.factorio.com/mod/CarLogistics

But if you want to do it yourself, it's just a matter of setting trash_inventory_size for the car to any value above 0. All my mod does is this:

local car = data.raw["car"]["car"]
car.trash_inventory_size = 20

If you feel like implementing this option, please feel free. If you want to be fancy, you can even trawl data.raw for all car prototype objects and set trash slots if those haven't been set already :)

a month ago
(updated a month ago)

Oh, I must not have looked closely enough at the tank prototype, didn't realize it would be that easy. That is basically exactly how I would implement it lol

a month ago

Unfortunate that the property doesn't apply to cargo wagon prototypes, but added the setting for "car" prototypes in v2.0.9

a month ago

Ooh! Neat. Assuming you're checking to make sure the car prototype entities don't already have trash slots? Dumb question, but just curious. Guess I don't need my own mod any more, then :)

a month ago
(updated a month ago)

I did not do any checking; it just overwrites whatever value is there (since I'm assuming this value won't be applied by any other mod, or would be the same value even if they do, since 20 is the default for tank)

a month ago

Not sure that's a safe assumption. It's entirely possible that some mods would add vehicles with their own logistics trash slots, which this will overwrite. I don't know that any exist (AAI vehicles don't seem to have it, and they were the ones I expected to use that feature), but it's a simple check. If 0 or nil, set. Otherwise, skip. Up to you how you go about it, obviously. Just throwing my c2 in.

New response