Page 1 of 1

on_player_selected_area not firing

Posted: Sat May 27, 2017 3:25 pm
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.

Re: on_player_selected_area not firing

Posted: Sat May 27, 2017 3:41 pm
by zackman0010
I can confirm this one is rather longstanding, since late 0.13/early 0.14 versions at least.

Re: on_player_selected_area not firing

Posted: Sat May 27, 2017 8:38 pm
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.

Re: on_player_selected_area not firing

Posted: Sat May 27, 2017 11:57 pm
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.

Re: on_player_selected_area not firing

Posted: Fri Jun 09, 2017 1:04 am
by 321freddy
Any news on this? I could really use this right now to modify some blueprints on creation.

Re: on_player_selected_area not firing

Posted: Fri Jun 09, 2017 5:30 am
by Rseding91
I've added 3 new events to handle how blueprints and deconstruction planners operate for the next version of 0.15.

Re: on_player_selected_area not firing

Posted: Fri Jun 09, 2017 11:30 am
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.