Skip to content

AAI Programmable Vehicles, error using Aircraft mod with Aircraft Realism present #391

@jaihysc

Description

@jaihysc

Description
Aircraft Realism is used to add takeoff to aircrafts from the Aircraft mod. This is accomplished by creating two planes, one with collision (grounded) and one without (airborne).

AAI Programmable Vehicles modifies the aircraft from the Aircraft mod to have no guns, but does not modify the airborne version. This causes a error when Aircraft Realism notices the grounded and airborne planes have different numbers of guns.

The mod Aircraft Realism (2.0.3) caused a non-recoverable error.
Please report this error to the mod author.

Error while running event AircraftRealism::on_tick (ID 0)
__AircraftRealism__/logic/planeController.lua:61: Old plane and new plane inventories are different sizes. Check plane prototypes
stack traceback:
	[C]: in function 'assert'
	__AircraftRealism__/logic/planeController.lua:61: in function 'copyInventory'
	__AircraftRealism__/logic/planeController.lua:230: in function 'transitionPlane'
	__AircraftRealism__/logic/planeController.lua:470: in function 'checkTransitionTakeoff'
	__AircraftRealism__/logic/planeController.lua:482: in function 'updateGroundedPlane'
	__AircraftRealism__/logic/planeController.lua:547: in function 'handler'
	__AircraftRealism__/control.lua:48: in function <__AircraftRealism__/control.lua:40>

I have been getting bug reports about this, but is not something the Aircraft Realism mod can fix.

To Reproduce

  1. Start a new save with Aircraft, Aircraft Realism, AAI programmable vehicles
  2. Get in a Cargo plane and try to take off

Possible Fix
For cargo plane, add the following 3 lines in prototypes/ai-vehicles.lua. Similar procedure applies for other planes.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions