Page 1 of 1
[2.0.66] UnitGroup distracts when defines.distraction.none
Posted: Fri Sep 12, 2025 2:44 pm
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:
Re: [2.0.66] UnitGroup distracts when defines.distraction.none
Posted: Fri Sep 12, 2025 3:54 pm
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.
Re: [2.0.66] UnitGroup distracts when defines.distraction.none
Posted: Fri Sep 12, 2025 6:00 pm
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:
Re: [2.0.66] UnitGroup distracts when defines.distraction.none
Posted: Sat Sep 13, 2025 8:11 am
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.