EarendelDevelopers / factorio-mods

This is a public repository for tracking issues with Earendel's factorio mods.
19 stars 3 forks source link

Mod conflict "AAI Programmable Vehicles" + "Companion Drones" + "Small Robots - Just make the two robots a little smaller" #273

Open keysivi opened 1 year ago

keysivi commented 1 year ago

Full correspondence and all data on this bug are available at: https://mods.factorio.com/mod/SmallRobots/discussion/63c8d6416d61e73662d1049d

Author of the mod "Small Robots - Just make the two robots a little smaller." - Pi-C said that only you can fully solve the problem.

Here is his message:

Thanks for the report! I suppose AAI is running after my mod, is that correct? Then adding

"(?) aai-programmable-vehicles"

to the dependencies in info.json should fix this.

Here is an extract from the log:

1.277 Error ModManager.cpp:1560: Не удалось загрузить мод "aai-programmable-vehicles": aai-programmable-vehicles/prototypes/ai-vehicles.lua:94: attempt to perform arithmetic on field '?' (a nil value)
stack traceback:
aai-programmable-vehicles/prototypes/ai-vehicles.lua:94: in function 'make_composite_unit_from_vehicle'

The critical line is the last one of these:

-- collision_box should be square otherwise it will get stuck during rotation vehicle.collision_box = vehicle.collision_box or {{0,0},{0,0}} local extent_min = math.min(-vehicle.collision_box[1][1], -vehicle.collision_box[1][2], vehicle.collision_box[2][1], vehicle.collision_box[2][2])

For making things more predictable while I work on the prototypes, I formatted the bounding boxes like this:

collision_box = { {x = x, y = y}, {x = x, y = y} }

Positions can be given as either {x, y} or {x = x, y = y}, and bounding boxes can be either { left_top = position_1, right_bottom = position_2 } or { position_1, position_2}. So the error is that Earendel doesn't check for all possible variations but assumes that the box will be in a particular format. But that's OK if he acts before I make my changes, so adding the dependency should work around that.

There's another problem though: AAI is trying to act on the companion drone! It really shouldn't do that. Sure, the companion is a spider-vehicle, but it's not meant to be used as a vehicle. You should tell Earendel to ignore the companion drones! (I've already blacklisted them in my WIP versions of GCKI and Autodrive, by the way.)

EDIT: I guess instead of adding specific names to our ignore-lists, we (AAI Programmable Vehicles, Autodrive, and GCKI) should outright ignore any vehicle where prototype.allow_passengers == false, that should prevent a lot of false positives!

Thank you!