[2.0.66] UnitGroup distracts when defines.distraction.none

This subforum contains all the issues which we already resolved.
artemlisonok
Manual Inserter
Manual Inserter
Posts: 4
Joined: Sat Jun 07, 2025 2:23 am
Contact:

[2.0.66] UnitGroup distracts when defines.distraction.none

Post by artemlisonok »

When I use LuaCommandable:set_command with defines.distraction.none, when LuaCoomandable is UnitGroup, the units still get distracted when they are attacked. However, this does not happen when LuaCoomandable is Unit.
Here is the test scenario:
distraction-test.zip
(920 Bytes) Downloaded 10 times
User avatar
boskid
Factorio Staff
Factorio Staff
Posts: 4174
Joined: Thu Dec 14, 2017 6:56 pm
Contact:

Re: [2.0.66] UnitGroup distracts when defines.distraction.none

Post by boskid »

Thanks for the report. I am not seeing any problems here.

By setting a command on a unit group with distraction none, you are making command of that unit group itself to not be distracted. This part is irrelevant for units getting distracted, because units are added to a unit group by means of a "group" command that by default is distracted by enemy. That means if a unit is distracted, it starts performing its own distraction command which makes it effectively stop following group commands and once distraction ends it goes back to following group command. If you want to change this behavior, you would have to add units to a unit group manually by setting a group command on them using a different distraction.
artemlisonok
Manual Inserter
Manual Inserter
Posts: 4
Joined: Sat Jun 07, 2025 2:23 am
Contact:

Re: [2.0.66] UnitGroup distracts when defines.distraction.none

Post by artemlisonok »

I updated the test scenario, added 2 groups in which units added via group command on corresponding unit. One unit with use_group_distraction = true, and another with use_group_distraction = false. But all gruops still get distracted when get attacked. Is this still not a bug?
Updated scenario:
distraction-test.zip
(1.13 KiB) Downloaded 11 times
User avatar
boskid
Factorio Staff
Factorio Staff
Posts: 4174
Joined: Thu Dec 14, 2017 6:56 pm
Contact:

Re: [2.0.66] UnitGroup distracts when defines.distraction.none

Post by boskid »

Thanks for the report. I looked more closely at what is happening and it looks like there is indeed an issue that got introduced around 1.1.51 because of 100894 which made units able to get distracted even when told not to be distracted. This issue should be now fixed for 2.0.67.
Post Reply

Return to “Resolved Problems and Bugs”