Aircraft Realism

by haih_ys

Adds mechanics to make vehicles behave as planes. [Takeoff/Landing, Runway Requirement]

Content
3 months ago
0.17 - 1.1
52.2K
Transportation

b ✔️ Crash landing the single existing plane

5 years ago

I have not debugged this, but ... I had a cargo plane, and I had no weapons in it. I could not, in fact, have weapons in it: it has no weapon inventory for me. I suspect this may involve AAI Programmable Vehicles or something, but either way, I think the root cause of the failure is obvious. :)

Error while running event AircraftRealism::on_tick (ID 0)
Index out of bounds.
stack traceback:
AircraftRealism/control.lua:219: in function 'TransitionPlane'
AircraftRealism/control.lua:179: in function 'PlaneLand'
AircraftRealism/control.lua:41: in function <AircraftRealism/control.lua:10>
stack traceback:
[C]: in function 'newindex'
__AircraftRealism
/control.lua:219: in function 'TransitionPlane'
AircraftRealism/control.lua:179: in function 'PlaneLand'
AircraftRealism/control.lua:41: in function <AircraftRealism/control.lua:10>

5 years ago

Ah, confirmed in AAI Programmable Vehicles. This is done in data-fixes-final, so your clone of the vehicles for airborne work would need be make in that phase as well, if you wanted to remain compatible with other mods.

-- aircraft mod
if data.raw.car["cargo-plane"] then
-- hauler types should not have guns
data.raw.car["cargo-plane"].guns = nil
end

5 years ago

....and confirmed, copying guns in data-fixes-final along with the soft dependency makes the problem vanish.

I'd strongly suggest you create the duplicates as late as possible, in that final phase, so that all the mutation by mods "compatible" with Aircraft happen well before you do your thing.

5 years ago
(updated 5 years ago)

Thanks for the bug report, I have moved the duplication of the airborne planes into data-final-fixes as you suggested.

I have added a check to see if the new plane has guns available to be selected when transitioning planes to hopefully better prevent this issue in the future.

New response