Hi yes I can help with that. Here are your mod's file updated to 2.0
info.json, change minimum AircraftRealism version and factorio_version
{
"name": "AC-Aircraft",
"version": "1.2.3",
"title": "AC Aircraft - PBY",
"author": "AngryCeltic/Turretproblems",
"dependencies": ["base >= 1.1.0", "AircraftRealism >= 2.0.0"],
"description": "Adds the PBY5 Catalina, a very famous aircraft to Factorio. This particular version has been made to more closely match the style of the game.",
"factorio_version": "2.0"
}
recipe.lua, expensive mode is gone, an icon is required
data:extend({
{
type = "recipe",
name = "PBY5",
enabled = false,
energy_required = 5,
ingredients =
{
{type = "item", name = "engine-unit", amount = 28},
{type = "item", name = "iron-plate", amount = 10},
{type = "item", name = "iron-gear-wheel", amount = 40},
},
results = {{type = "item", name = "PBY5", amount = 1}},
icon = "__AC-Aircraft__/graphics/PBY5_icon.png"
},
})
technology.lua, no space allowed in name property
data:extend({
{
type = "technology",
name = "EarlySeaplanes",
icon_size = 128, icon_mipmaps = 4,
icon = "__AC-Aircraft__/graphics/PBY5_icon.png",
effects =
{
{ type = "unlock-recipe", recipe = "PBY5" },
},
prerequisites = {"automobilism"},
unit =
{
count = 250,
ingredients =
{
{"automation-science-pack", 1},
{"logistic-science-pack", 1},
},
time = 30
},
order = "e-c-c"
},
})
entity.lua, modify collision_mask, add energy source
You can play around with the collision masks and make it burn fuel
-- item = true, meltable = true, object = true, player = true, is_object = true, is_lower_object = true
collision_mask = { layers = {object = true}},
energy_source = {type = "void"},
Now to make it fly
-- data.updates.lua
local api = require("__AircraftRealism__.api")
local flyingPlane = table.deepcopy(data.raw.car["PBY5"])
flyingPlane.name = "PBY5-flying"
flyingPlane.collision_mask = { layers = {} }
-- Remove the shadow layer
flyingPlane.animation = { layers = {flyingPlane.animation.layers[1], flyingPlane.animation.layers[2]}}
data:extend{flyingPlane}
-- Create the shadows
spriteNames = {}
for i=0,63 do
local fileIdx = math.floor(i / 8) + 1
local yOffset = i % 8
spriteNames[i + 1] = "PBY5-shadow-" .. tostring(i)
local sprite = {
type = "sprite",
name = "PBY5-shadow-" .. tostring(i),
filename = "__AC-Aircraft__/graphics/PBY5-shadow-" .. tostring(fileIdx) .. ".png",
width = 1024,
height = 1024,
x = 0,
y = yOffset * 1024,
shift = util.by_pixel(20, -10/3),
scale = 0.75
}
data:extend{sprite}
end
api.register_plane({
grounded_name = "PBY5",
airborne_name = "PBY5-flying",
transition_speed_setting = "aircraft-transition-speed-PBY5",
shadow_sprite = spriteNames,
shadow_end_speed = 50 / 216 -- Animation ends 50 km/h after takeoff
})
settings.lua
data:extend({
{
type = "double-setting",
name = "aircraft-transition-speed-PBY5",
setting_type = "runtime-global",
minimum_value = 10,
default_value = 139,
},
})