Lex's Aircraft

by lexsus

Your attention is presented to the futuristic VTOL aircraft that are well suited to the style of the game. The mod includes aircraft: transport, light combat, heavy combat.

Content
8 months ago
1.1 - 2.0
64.3K
Transportation Combat

g Error with K2

5 months ago

Failed to load mods: lex-aircraft/prototypes/k2items.lua:19: attempt to index field 'kr-more-realistic-weapon' (a nil value)
stack traceback:
lex-aircraft/prototypes/k2items.lua:19: in main chunk
[C]: in function 'require'
lex-aircraft/data-updates.lua:3: in main chunk

2 months ago

same here

2 months ago

Same here

a month ago

The integration with k2 is very outdated. I gave up on renaming the equipment categories, and before that, there were settings, weapon names, and fuel subgroups.

Managed to (sorta?) fix this error and get the mod working with K2 and SE. Hanuryk got the right idea about renaming the outdated parts of the code. Here is the changes I made in the lua files:

data-updates:

if mods["Krastorio2"] then
require("prototypes.k2items")
data.raw["spider-vehicle"]["lex-flying-cargo"].energy_source.fuel_categories = { "kr-vehicle-fuel" }
data.raw["spider-vehicle"]["lex-flying-gunship"].energy_source.fuel_categories = { "kr-vehicle-fuel" }
data.raw["spider-vehicle"]["lex-flying-heavyship"].energy_source.fuel_categories = { "kr-vehicle-fuel" }
data.raw["equipment-grid"]["lex-flying-cargo-grid"].equipment_categories = {
"kr-vehicle",
"kr-vehicle-motor",
"kr-vehicle-roboport",
}
data.raw["equipment-grid"]["lex-flying-gunship-grid"].equipment_categories = {
"kr-vehicle",
"kr-vehicle-motor",
"kr-vehicle-roboport",
}
data.raw["equipment-grid"]["lex-flying-heavyship-grid"].equipment_categories = {
"kr-vehicle",
"kr-vehicle-motor",
"kr-vehicle-roboport",
}
data.raw["equipment-grid"]["lex-flying-heavyship-grid"].equipment_categories = {
"kr-vehicle",
"kr-vehicle-motor",
"kr-vehicle-roboport",
}
table.insert(data.raw["spider-vehicle"]["lex-flying-heavyship"].guns, "rocket-launcher")
if settings.startup["kr-realistic-weapons"].value then
table.insert(data.raw["spider-vehicle"]["lex-flying-heavyship"].guns, "lex-advanced-machine-gun")

k2items.lua:

if mods["Krastorio2"] and settings.startup["kr-realistic-weapons"].value then
data:extend({
{
type = "gun",
name = "lex-advanced-machine-gun",
icon = "Krastorio2Assets/icons/guns/advanced-tank-machine-gun.png",
icon_size = 64,
hidden = true,
subgroup = "gun",
order = "z[tank]-a[advanced-tank-machine-gun]",
attack_parameters = {
type = "projectile",
ammo_category = "kr-anti-materiel-rifle-ammo",

New response