Transport Drones

by Klonan

Adds transport drones and transport depots

Content
11 months ago
0.18 - 1.1
77.4K
Logistics

b Destructively setting collision_mask

2 years ago
(updated 2 years ago)

Hi Klonan,

In data-final-fixes.lua, you're destructively setting the collision_mask on line 39:

tile.collision_mask = {road_collision_layer}

Would it be possible to ask you to revise this? As it stands, any other mods that attempt to add collision masks to your roads, if they load first, the changes are overwritten and are forced to set your mod as an optional dependent just to fix. From my (limited) testing, I don't see anything that breaks by allowing another collision mask in there?

2 years ago

I had many problems with mods doing exactly that, and breaking my mod, which is why I have it there specifically

What is the use case for messing with the road collision mask?

2 years ago
(updated 2 years ago)

The reason is fairly minor when it comes down to it (cosmetic, even). I have a mod I’m working on to prevent planting of trees (where enabled by other mods) on or too close to certain tile types I’m classifying as “artificial”, such as concrete and roads. I use a fake offshore-pump entity as the initial placer so the trees can be planted close to each other (without overlapping), but then the adjacent_tile_collision properties are used to keep it back from the artificial tiles. Once placed, my control code swaps it out for the actual tree and places a simple-entity (“tree-roots”) under the tree to prevent the reverse - placing of tiles too close to the tree.

With your mod’s destructive setting of the collision mask, while it does still prevent planting the trees directly on the road, it causes the fake offshore-pump’s adjacent tile piece and the “tree-roots” to not work the way they’re supposed to.

Not a big deal I guess. If you like, I do have a global variable that contains a function for registering entities and tiles with my mod. Though I’m not done with the mod as a whole, yet, and as such it is unreleased, I can give you the code snippet you’d need to add to yours to make them work together. Calling this and passing your road prototypes will cause my mod to insert the needed collision mask. Barring that, I can ultimately just set yours as an optional dependent.

New response