Page 1 of 1

[1.1.104] Laser turret shoots at out of range target repeatedly doing no damage

Posted: Mon Feb 12, 2024 8:21 am
by BurninSun
Laser turrets will shoot at targets that are slightly out of range and do no damage to them, resulting in the turret repeatedly toggling its fire. It should either not fire, or apply the damage.
laser.png
laser.png (551.36 KiB) Viewed 595 times
Stripped down save file attached.
Broken laser.zip
(10.22 MiB) Downloaded 43 times

Re: [1.1.104] Laser turret shoots at out of range target repeatedly doing no damage

Posted: Mon Feb 12, 2024 10:08 pm
by Rseding91
Thanks for the report. This is due to a combination of things:

* The laser turret has no idea if after it "fires" that the beam it will create (if it will even create a beam) is within the valid distance from the source (laser) to the target (asteroid). The laser simply has attack_parameters with a max range set and a trigger to run when a target is within that range. What the trigger does is outside the scope of the laser shooting logic.

* The beam created checks the distance from the source-center (laser in this instance) to the target-rotated-bounding-box.

* The laser attack_parameters are configured to use the "range mode" of "center to center" (the default) instead of "bounding box to bounding box"

It looks like the laser is using the same definitions as the base game laser so the changes will end up being in base game to most likely slightly extend the laser beam max distance.