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

b [Possibly Fixed] Error on starting the game, hovercraft related?

27 days ago
(updated 27 days ago)

Hi, when i will start the game after updating your mod to 2.1.0 i get the following error.
Idk if it depends on incompatibilty with anoter mod or not.

Fehler beim Laden der Mods: kry-vehicle-grids/func.lua:32: attempt to index field '?' (a nil value)
stack traceback:
kry-vehicle-grids/func.lua:32: in function 'changeEquipmentCategories'
kry-vehicle-grids/prototypes/mod-compatability.lua:239: in main chunk
[C]: in function 'require'
kry-vehicle-grids/data.lua:13: in main chunk

Edit: After checking the revelant lines, (that says mod "hovercraft") i can confirm that it depends on "Hovercraft". After disable these mod, its starting.
Edit2: Error happens when Electric Hovercraft and Laser Hovercraft is enabled.
So i hope this helps.

27 days ago

Hm, that's odd, I am unable to recreate this error, regardless of hovercraft settings, either on v2.1.0 or the latest v2.1.1 (just uploaded, but probably shouldn't make a difference in regards to hovercrafts). When running just hovercrafts and this mod, it seems to load properly in every case.

27 days ago
(updated 27 days ago)

Magic Bug? I dont know what you changed exactly in 2.1.1
With 2.1.1 works great.
(And test-based i had changed back to 2.1.0, still happens.) But that no longer matters.

So thanks for the mod in genereal and thx for fixing whatever the reason was.

27 days ago

How unusual... while I'm concerned that it happened in the first place (I've spent like 3 days straight working on the latest update to support all vehicle mods, under as many different settings and conditions possible lol), I'm glad to hear that it's working now, at least. I'll tentatively mark this as fixed v2.1.1, in case the error on start returns.

27 days ago

Because im curious i had checked what you had changed thats possibly related to the error:
func.lua:
Data(equipmentGrid,"equipment-grid"):set_field("equipment_categories",newCategories)
--data.raw["equipment-grid"][equipmentGrid].equipment_categories = newCategories

first line doesnt exist in 2.1.0
second line was set as active (no commentary) in 2.1.0

In summary in 2.1.1 i had tested some different settings with vehicle-based mods that i use.
And finally changed back all settings thats in my savegame. Still works fine with 2.1.1.
So I think it is fixed, due to the change of the lines see above

27 days ago
(updated 27 days ago)

Ahh, I remember that line now, it was giving me issues in certain situations (that I couldn't quite pin down), so I replaced the line with a very similar one that uses stdlib functions for crash protection.

If the core problem wasn't actually fixed (the reason that nil values were being passed in the first place), I think this method would add something to the log without crashing, but it might still not be working as intended.

The most apparent issue would be the vehicle not having the correct equipment available for its vehicle type. If hovercraft is missing the speed booster, or has access to exoskeleton legs, for example, then it might not be working as intended. But then again, I did add some follow-up scripts that could be patching up any remaining issues with not having the correct equipment categories set.

Let me know if you notice any inconsistencies with the hovercraft; I believe it should have the same equipment available as the car.

New response