How do I access the event when left clicking entity
Posted: Sun Sep 02, 2018 5:52 pm
I'm trying to add a function when a user left clicks on an entity and I am having trouble.
Anyone have any insights?
Anyone have any insights?
www.factorio.com
https://forums.factorio.com/
That's the wrong approach btw. But i don't want to write details about how to do it correctly unless OP gives a very good reason he actually needs that.bobingabout wrote:Yeah... I mean, you could write your own event triggered by left click, and then when it triggers check to see if there's an entity selected.
I never really was that up on the scripting side, back in the early days, scripting broke things, so one of the promises of my mod was that I'd try to solve everything without using multiplayer breaking or game slowdown scripting.eradicator wrote:That's the wrong approach btw. But i don't want to write details about how to do it correctly unless OP gives a very good reason he actually needs that.bobingabout wrote:Yeah... I mean, you could write your own event triggered by left click, and then when it triggers check to see if there's an entity selected.
bobingabout wrote:I never really was that up on the scripting side, back in the early days, scripting broke things, so one of the promises of my mod was that I'd try to solve everything without using multiplayer breaking or game slowdown scripting.eradicator wrote:That's the wrong approach btw. But i don't want to write details about how to do it correctly unless OP gives a very good reason he actually needs that.bobingabout wrote:Yeah... I mean, you could write your own event triggered by left click, and then when it triggers check to see if there's an entity selected.
and I've pretty much kept that promise, there is scripting in select places where it was required, but nothing that should break multiplayer or cause slow downs.
in any case, there are a lot of ways to do things, and some are better than others.
Gnarf. Please use a linked_game_control instead of an arbitrary mouse button if you're going that way...unhott wrote: Mon Sep 10, 2018 11:50 pm I didn't realize custom inputs could have key sequence = mouse-button-n.
https://wiki.factorio.com/Prototype/Cus ... me_control :)eradicator wrote: Tue Sep 11, 2018 12:49 pm Gnarf. Please use a linked_game_control instead of an arbitrary mouse button if you're going that way...
(The wiki seems down so i can't post a link.)
I still get a 404 on that.Bilka wrote: Tue Sep 11, 2018 1:00 pmhttps://wiki.factorio.com/Prototype/Cus ... me_control :)eradicator wrote: Tue Sep 11, 2018 12:49 pm Gnarf. Please use a linked_game_control instead of an arbitrary mouse button if you're going that way...
(The wiki seems down so i can't post a link.)
ctrl + F5, restarting my browser, or using a private window have helped for that throughout today, though for me everything is working now.
Refreshing did indeed work. Why is the wiki redirecting from wiki.factorio.com to wikix.factorio.com though?Bilka wrote: Tue Sep 11, 2018 4:18 pmctrl + F5, restarting my browser, or using a private window have helped for that throughout today, though for me everything is working now.