on_player_selected_area not firing

Post Reply
User avatar
Mylon
Filter Inserter
Filter Inserter
Posts: 513
Joined: Sun Oct 23, 2016 11:42 pm
Contact:

on_player_selected_area not firing

Post by Mylon »

I fired up a new game and ran this command:

Code: Select all

/c script.on_event(defines.events.on_player_selected_area, function(event) game.print("Player selected area") for k,v in pairs(event.entities) do game.print(v.name) end end)
And then grabbed a decon planner and tried to deconstruct a tree.

Observed behavior: Nothing.

Expected behavior: Messages, "Player selected area" and "tree-05" is printed.

I would like to be able to use this event to detect if event.item == "deconstruction-planner" and event.entities include a "rocket-silo", or if a certain number of entity.types are selected.
Last edited by Mylon on Sat May 27, 2017 4:03 pm, edited 1 time in total.

zackman0010
Inserter
Inserter
Posts: 36
Joined: Wed May 18, 2016 8:34 pm
Contact:

Re: on_player_selected_area not firing

Post by zackman0010 »

I can confirm this one is rather longstanding, since late 0.13/early 0.14 versions at least.

Rseding91
Factorio Staff
Factorio Staff
Posts: 13209
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: on_player_selected_area not firing

Post by Rseding91 »

Deconstruction planners and blueprints don't fire that event. The event specifically says it only fires with the selection-tool item type.

I'll look into the reason why I made it work that way and see about changing it.
If you want to get ahold of me I'm almost always on Discord.

zackman0010
Inserter
Inserter
Posts: 36
Joined: Wed May 18, 2016 8:34 pm
Contact:

Re: on_player_selected_area not firing

Post by zackman0010 »

Thank you. I was under the impression that it should be firing because Blueprint and DeconPlanner types were children of the selection-tool type, which is why I thought it was a bug.

321freddy
Fast Inserter
Fast Inserter
Posts: 125
Joined: Fri Sep 23, 2016 10:16 pm
Contact:

Re: on_player_selected_area not firing

Post by 321freddy »

Any news on this? I could really use this right now to modify some blueprints on creation.

Rseding91
Factorio Staff
Factorio Staff
Posts: 13209
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: on_player_selected_area not firing

Post by Rseding91 »

I've added 3 new events to handle how blueprints and deconstruction planners operate for the next version of 0.15.
If you want to get ahold of me I'm almost always on Discord.

321freddy
Fast Inserter
Fast Inserter
Posts: 125
Joined: Fri Sep 23, 2016 10:16 pm
Contact:

Re: on_player_selected_area not firing

Post by 321freddy »

Rseding91 wrote:I've added 3 new events to handle how blueprints and deconstruction planners operate for the next version of 0.15.
Awesome thanks! :D Any ETA on 0.15.20? There is no point in doing any other methods of blueprint modification when I know that it's going to be a lot easier.

Post Reply

Return to “Implemented mod requests”