Page 1 of 1

[0.12.8] Set_multi_command – Attack - Issue

Posted: Wed Sep 23, 2015 5:15 pm
by TheSAguy
I’m not calling it a bug precisely, but have an issue with this command and hope that when the devs have a moment, between real bugs, they could possibly take a look at this.

It seems that this command has a radius, area of effect, that is not very big.

When using the below command:

Code: Select all

game.get_surface(1).set_multi_command({type=defines.command.attack,target=game.player.character,distraction=defines.distraction.none},200)
In theory, the closest 200 biters should attack, but this only affects the biters on a small radius from where the command is executed. When you execute this in a large base, with no biters close by, nothing happens.

I’m hoping that the search radius could be expanded or force the closest x, in my case 200 biters to respond.
Thanks.

Re: [0.12.8] Set_multi_command – Attack - Issue

Posted: Thu Oct 01, 2015 7:00 am
by Rseding91
I believe the actual issue here is there are no biters active on the map. The pollution has not reached the biters and the player isn't near them so they go inactive and set_multi_command doesn't see them.

Edit: I guess I was wrong :D
There is no "range" limit on the command - if a biter is 20,000 tiles away the command will still see them.

Re: [0.12.8] Set_multi_command – Attack - Issue

Posted: Thu Oct 01, 2015 1:12 pm
by slpwnd
LoL, actually there is a hardcoded limit of 150 tiles in the code which selects the units for the multi command :D

Re: [0.12.8] Set_multi_command – Attack - Issue

Posted: Thu Oct 01, 2015 3:54 pm
by TheSAguy
slpwnd wrote:LoL, actually there is a hardcoded limit of 150 tiles in the code which selects the units for the multi command :D
Slpwnd,
Is there anyway you can make the tile limit a variable or at least increase it a little?
Currently, when I use the command in a large base, nothing happens, since I've cleared out everyone within the 150 tile limit.

:arrow: Darn Modders asking for stuff again!
Thanks.

Re: [0.12.8] Set_multi_command – Attack - Issue

Posted: Wed Oct 07, 2015 7:42 am
by slpwnd
TheSAguy wrote:
slpwnd wrote:LoL, actually there is a hardcoded limit of 150 tiles in the code which selects the units for the multi command :D
Slpwnd,
Is there anyway you can make the tile limit a variable or at least increase it a little?
Currently, when I use the command in a large base, nothing happens, since I've cleared out everyone within the 150 tile limit.

:arrow: Darn Modders asking for stuff again!
Thanks.
It is now fixed for the next release. The signature has changed since there started to be too many unnamed parameters. So the example usage now would be:

Code: Select all


    game.player.surface.set_multi_command{command = {type=defines.command.attack, target=game.player.character, distraction=defines.distraction.by_enemy},
                                                                  unit_count = global.attack_count,
                                                                  unit_search_distance = 300}

Where unit_search_distance is optional and you can also specify optional force (by default set to enemy). The search distance is calculated from the target location of the command - so here from the character position.

Re: [0.12.8] Set_multi_command – Attack - Issue

Posted: Wed Oct 07, 2015 4:09 pm
by TheSAguy
You are da-MAN!
Thanks slpwnd!!