Hi haih_ys - Thanks for your continued support! This check might need nested logic, because I think according to the trace it finds a non-existent weapon and then immediately tries to run the validation check.
Error while running event AircraftRealism::on_tick (ID 0)
__AircraftRealism__/logic/planeTakeoffLanding.lua:38: attempt to compare nil with number
stack traceback:
__AircraftRealism__/logic/planeTakeoffLanding.lua:38: in function 'transitionPlane'
__AircraftRealism__/logic/planeTakeoffLanding.lua:124: in function 'planeLand'
__AircraftRealism__/logic/planeManager.lua:49: in function 'checkPlanes'
__AircraftRealism__/control.lua:13: in function <__AircraftRealism__/control.lua:8>
I also realized that AAI sets their vehicles to have only 1 gun per vehicle (and hard sets the index in the AAI Programmable Vehicles mod), which I am not sure exactly why but am going to ask in their discord. This is probably why they are not playing nice together.
[Update]
I think I found the problem, in the AAI mod he created a forced exception for the Aircraft vehicles:
-- aircraft mod
if data.raw.car["cargo-plane"] then
-- hauler types should not have guns
data.raw.car["cargo-plane"].guns = nil
end
-- more than 2 variants is excessive
if data.raw.car["gunship"] then
data.raw.car["gunship"].guns = { "aircraft-machine-gun", "aircraft-rocket-launcher"}
end
if data.raw.car["jet"] then
data.raw.car["jet"].guns = { "aircraft-machine-gun", "napalm-launcher"}
end
if data.raw.car["flying-fortress"] then
data.raw.car["flying-fortress"].guns = { "aircraft-cannon", "flying-fortress-rocket-launcher"}
end
I'm going to try and remove that code and use the exclude-vehicles flag for AAI and see if everything gets resolved.