[0.12.8] Set_multi_command – Attack - Issue

This subforum contains all the issues which we already resolved.
TheSAguy
Smart Inserter
Smart Inserter
Posts: 1449
Joined: Mon Jan 13, 2014 6:17 pm
Contact:

[0.12.8] Set_multi_command – Attack - Issue

Post 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.
Rseding91
Factorio Staff
Factorio Staff
Posts: 14363
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [0.12.8] Set_multi_command – Attack - Issue

Post 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.
If you want to get ahold of me I'm almost always on Discord.
slpwnd
Factorio Staff
Factorio Staff
Posts: 1835
Joined: Sun Feb 03, 2013 2:51 pm
Contact:

Re: [0.12.8] Set_multi_command – Attack - Issue

Post by slpwnd »

LoL, actually there is a hardcoded limit of 150 tiles in the code which selects the units for the multi command :D
TheSAguy
Smart Inserter
Smart Inserter
Posts: 1449
Joined: Mon Jan 13, 2014 6:17 pm
Contact:

Re: [0.12.8] Set_multi_command – Attack - Issue

Post 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.
slpwnd
Factorio Staff
Factorio Staff
Posts: 1835
Joined: Sun Feb 03, 2013 2:51 pm
Contact:

Re: [0.12.8] Set_multi_command – Attack - Issue

Post 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.
TheSAguy
Smart Inserter
Smart Inserter
Posts: 1449
Joined: Mon Jan 13, 2014 6:17 pm
Contact:

Re: [0.12.8] Set_multi_command – Attack - Issue

Post by TheSAguy »

You are da-MAN!
Thanks slpwnd!!
Post Reply

Return to “Resolved Problems and Bugs”