Today's FFF describes new map generator bounding box added to entities to fix up enemy bases.
Please make sure that there is an option in can_place_entity that will make it use same bounding box so mods can use it when placing enemy bases.
Add ability to use map generator bounding box in can_place_entity
Re: Add ability to use map generator bounding box in can_place_entity
That's not likely to ever happen.
Map generation has exactly 2 places where it checks if an entity would collide with the world and it completely ignores the rest of the logic in those 2 places.
Making can-place-entity work with different bounding boxes is asking for the entire buildability check system to be re-written and as I said above: that's not likely to ever happen.
An entity is buildable if it's buildablity check passes. It's placeable through the ma generator if the basic map generator bounding box doesn't collide *and* the normal buildability checks pass.
Map generation has exactly 2 places where it checks if an entity would collide with the world and it completely ignores the rest of the logic in those 2 places.
Making can-place-entity work with different bounding boxes is asking for the entire buildability check system to be re-written and as I said above: that's not likely to ever happen.
An entity is buildable if it's buildablity check passes. It's placeable through the ma generator if the basic map generator bounding box doesn't collide *and* the normal buildability checks pass.
If you want to get ahold of me I'm almost always on Discord.
Re: Add ability to use map generator bounding box in can_place_entity
So maybe a separate method for this?
If there is no access to this then RSO bases will still have bugs while base game ones won't. This is kind od dissapointing.
Basically I need to reimplement this logic on lua side somehow or RSO bases wil be subpar.
If there is no access to this then RSO bases will still have bugs while base game ones won't. This is kind od dissapointing.
Basically I need to reimplement this logic on lua side somehow or RSO bases wil be subpar.
Re: Add ability to use map generator bounding box in can_place_entity
I'm not against adding a simple LuaSurface::collides(boudning box, collision mask, direction) - which is what the map generation logic uses. But I'm never going to re-write the entire can-build-entity collision system to support arbitrary collision boxes.
If you want to get ahold of me I'm almost always on Discord.
Re: Add ability to use map generator bounding box in can_place_entity
That would work as long as new collision box is available from prototype.
Re: Add ability to use map generator bounding box in can_place_entity
It wasn't available so I added LuaEntityPrototype::map_generator_bounding_box. Now nothing should be in the way of adding LuaSurface::collides().
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.
Re: Add ability to use map generator bounding box in can_place_entity
Since request is in won't implement should I add new one for simple collision?
I actually had an idea for slightly different way.
Add a version of find_non_colliding_position that would accept collision box instead of name of entity prototype.
It could use then either of collision masks depending on how you call it.
I actually had an idea for slightly different way.
Add a version of find_non_colliding_position that would accept collision box instead of name of entity prototype.
It could use then either of collision masks depending on how you call it.