Vehicle Grid

by Optera

Adds a configurable equipment grid to any base or modded vehicle without grid.

Content
3 years ago
0.15 - 1.1
16.7K
Armor

i Krastorio Support

5 years ago

Hey. I discussed with one of Krastorio's authors (Linver) about adding a generic equipment grid for vehicles (for instance AAI's vehicles without Programmable Vehicles). And Vehicle Grid came to mind, but Krastorio uses different categories than vanilla so the "armor" grid added by this mod doesn't help. Thus the reason I'm here. I'd like to request support for the Krastorio mod.

Basically, Krastorio uses a few different categories, for vehicles the relevant ones are "universal-equipment" (for player and vehicles), "vehicle-equipment" (for vehicles-only) and "vehicle-motor" (so motors, to increase movespeed of vehicles).

I made a quick and dirty edit to your grid-equipment.lua and ran it by Linver before testing it and everything seem to work. (Except that Exoskeletons can be used in vehicle's grid because of the "armor" category, but that's all.) According to Linver, the "armor" category has to stay for compatibility reasons.

Here's my edit: https://pastebin.com/3EYurpXQ

As I said, it's a quick and dirty one which really just modifies categories to suit Krastorio's. I don't have much experience, so you'll have to do the rest yourself if you decide to accept that request.

5 years ago
(updated 5 years ago)

I don't do quick and dirty.
If I add support for Krastorio I need to know what equipment categories it has and what vehicle grids those should match. Then I'll use mod detection to change grid categories accordingly.

Are the changes you made a complete list of categories with armor being only for compatibility if Krastorio is not installed?

5 years ago
(updated 5 years ago)

And that's all to your credit. I'll try to provide whatever information I have.

Krastorio uses four categories*: universal-equipment, vehicle-equipment, character-equipment, and vehicle-motor. Character-equipment is irrelevant here since it only contains items for player-only use.
- "universal-equipment" can safely be used for everything, wheter players or vehicles, no matter which.
- "vehicle-equipment" includes things that are restricted to vehicles, but can be used for any vehicle.
- "vehicle-motor" includes movespeed-based equipment which can be used on most vehicles, but not on wagons for instance.

*I also saw it using the "armor" category for one or two player-only items (for instance, the exoskeleton I mentioned), but, yeah. Nothing to do with vehicles.

Given that, I added "universal-equipment" and "vehicle-equipment" to all 5 categories (car, tank, locomotive, wagon and artillery wagon) but "vehicle-motor" only for car, tank and locomotives for the reason mentioned above.

As for armor, it's apparently to ensure compatibility if another mod adds something with this category rather than if Krastorio isn't installed. Though that doesn't change much to the end result I guess.

Also, unless it's outside the scope of that mod, do you perhaps have a way to also add these categories (without changing the grid size) to vehicles which already have a grid?

5 years ago
(updated 5 years ago)

Thanks I already found that information in Krastorios code.
Going by how Krastorio treats base vehicles armor should be removed if it's active, the other categories are just like your edit.

Generally overwriting existing grids will cause a lot of incompatibilities. Planes for example are just car entities without collisions and fancy graphics.
However when Krastorio is detected I will overwrite base vehicles to use the configurable grids from Vehicle Grid.

5 years ago

Neat.

I see. I thought that you could just somehow append new equipment categories to the existing ones, but if you have to overwrite everything, I can imagine how it would lead to all kind of issues.

5 years ago
(updated 5 years ago)

You can append, but it will result in ugly situations like Exoskeletons in vehicles.

I've added a setting to overwrite none, all or base only vehicle grids as well as hopefully full support for bobs, krastorio and some tank mods i found.

5 years ago

You… sure weren't joking when you said that you don't do quick and dirty.

Thank you for adding compatibility and all these options. That's much more than I would ever have asked.

New response