Page 1 of 1

[2.0.31] Railguns mark targets that don't collide with the beam as in the danger zone, when they can't be damaged

Posted: Fri Jan 17, 2025 11:56 pm
by LeonSkills
Consider an entity with no collision mask layers. It collides with no objects.

Code: Select all

data.raw["assembling-machine"]["cryogenic-plant"].collision_mask = {layers = {}}
When this entity is placed in front of a railgun and the player selects the railgun, it still marks this entity has being in danger of being damaged.
However when the railgun shoots through the entity, the entity is not damaged.

Image

(Cryogenic plant has no collision mask layers, the oil refinery is unchanged)

Expected behaviour: When selecting/placing a railgun turret it does not show the red marks around the selection box of entities that can't be damaged by the railgun, in this case, the cryogenic plant.

Usecase: I've got some invisible entities in my mod that will trigger some effects when a player hovers over it. Their selection box becomes visible when placing railgun turrets.

---


I checked some more collision_mask settings:

Having it collide with some collision layers but setting "colliding_with_tiles_only" also results in it not being destroyed but still being marked.

Code: Select all

data.raw["assembling-machine"]["cryogenic-plant"].collision_mask = {
  layers                    = {["player"] = true},
  colliding_with_tiles_only = true
}
As well as setting it to indestructable "/c game.player.selected.destructible = false".
But that can change at runtime, so I don't necessarily consider it a bug in that case.

Re: [2.0.31] Railguns mark targets that don't collide with the beam as in the danger zone, when they can't be damaged

Posted: Tue Feb 18, 2025 3:45 pm
by Rseding91
Thanks for the report however I do not believe we will be changing this. There is no way to know which projectile will actually be fired when hovering the turret and it simply highlights everything within its firing arc that it might impact.