Eyedropper - An easier way to pick items from your inventory

Topics and discussion about specific mods
Tinyboss
Filter Inserter
Filter Inserter
Posts: 467
Joined: Sun Nov 16, 2014 12:11 pm
Contact:

Eyedropper - An easier way to pick items from your inventory

Post by Tinyboss »

NOTE: This mod is deprecated. I made a much better version using billw's excellent suggestion.

Type: Mod
Name: Eyedropper
Description: Easier selection of items from your inventory.
License: Public domain
Version: 0.0.2
Release: 2015-08-07
Tested-With-Factorio-Version: 0.12.2
Category: Convenience
Tags: Inventory, Convenience
Download-Url: https://dl.dropboxusercontent.com/u/118 ... _0.0.2.zip
Website:
License
Long description
Version history
Last edited by Tinyboss on Mon Aug 10, 2015 4:48 pm, edited 7 times in total.
Lemures
Burner Inserter
Burner Inserter
Posts: 7
Joined: Sun Sep 14, 2014 4:28 pm
Contact:

Re: Eyedropper - An easier way to pick items from your inventory

Post by Lemures »

To anyone curious about if you should use this: You should. I did not expect it to add as much to the game as it does.

To tinyboss: I'm not familiar enough with modding to know: Is there a way to only have this work if the mouse is within a bounded box of, say, 20% the screen size or so? Too often I rest the mouse over something to see its status (such as the amount of fluid in a pipe) and that item gets selected. If this behavior only occurred if I was relatively near the item, I feel this would be better. Also, please just email the devs and ask how to get the middle mouse working. This would make this one of the top downloaded mods I'm sure :). Thank you for the work you put in, this is a great mod!
OBAMA MCLAMA
Filter Inserter
Filter Inserter
Posts: 337
Joined: Fri May 30, 2014 4:23 am
Contact:

Re: Eyedropper - An easier way to pick items from your inventory

Post by OBAMA MCLAMA »

If he can get the entity under the cursor, im sure he can get the distance between player and entity.
When i stream twitch i always answer questions and try to help, come visit me.
Tinyboss
Filter Inserter
Filter Inserter
Posts: 467
Joined: Sun Nov 16, 2014 12:11 pm
Contact:

Re: Eyedropper - An easier way to pick items from your inventory

Post by Tinyboss »

Thanks for the feedback!

Having used it myself for a couple of days, I realize that it does get in the way of checking the status of things. I considered limiting it to a radius around the player, but I use it on distant objects frequently enough that I decided against that. Of course, the ideal solution would be to have it bound to the middle mouse button, but that's not accessible currently. I've thought of three possible compromises:
  1. Limit the picker to a radius around the character. A problem with this is that without a visual indication of the active range, you could find yourself hovering over an item and wondering why it's not working.
  2. Disable the picker for items you frequently hover over to check status. It's especially a problem with chests where you might need a couple of seconds to find the thing you're interested in. One second is usually long enough to check a pipe. Although, you sometimes just want to watch pipes for a while, so there's that.
  3. Make it so that once you clear your cursor with Q, it won't pick that item again until you move your cursor off of it. It would still bother you one time, but then you could hit Q and watch the status for as long as you want.
I'm leaning toward #3, but I'm definitely open to ideas.
Lemures
Burner Inserter
Burner Inserter
Posts: 7
Joined: Sun Sep 14, 2014 4:28 pm
Contact:

Re: Eyedropper - An easier way to pick items from your inventory

Post by Lemures »

What about a combination: #3 (which I quite like), combined with limiting to the build radius of the player. That radius is a bit "intuitive" to a player who has played for a while, so there wouldn't be much need for a visual indicator.
Tinyboss
Filter Inserter
Filter Inserter
Posts: 467
Joined: Sun Nov 16, 2014 12:11 pm
Contact:

Re: Eyedropper - An easier way to pick items from your inventory

Post by Tinyboss »

Lemures wrote:What about a combination: #3 (which I quite like), combined with limiting to the build radius of the player. That radius is a bit "intuitive" to a player who has played for a while, so there wouldn't be much need for a visual indicator.
It's even better than that, actually: the little highlight cursor is yellow if you're in build/interact range and red if not, which overcomes my main objection to limiting the range. I made both changes and uploaded a new version (link updated in the OP). I made it so that the old infinite range can be restored by changing one line in the control.lua file, but I'm going to use it with limited range for a while to see how it feels.

I also removed the message for when you don't have an item in your inventory. I think it was annoying.

Thanks again for using it and giving feedback!
theit8514
Inserter
Inserter
Posts: 47
Joined: Sun Apr 20, 2014 2:11 am
Contact:

Re: Eyedropper - An easier way to pick items from your inventory

Post by theit8514 »

For some reason, on_tick is getting called before on_load has a chance to create the eyedrop variable. Maybe an on_init would be better for setting up the object. Creating a new game results in: __Eyedropper__/control.lua:50: attempt to index global 'g' (a nil value)

In addition, this if statement can be flipped to short-circuit the call to can_reach_entity since infinite_range is either always true or always false (it never changes unless the lua changes which requires a restart):

Code: Select all

(p.can_reach_entity(p.selected) or g.infinite_range)
Tinyboss
Filter Inserter
Filter Inserter
Posts: 467
Joined: Sun Nov 16, 2014 12:11 pm
Contact:

Re: Eyedropper - An easier way to pick items from your inventory

Post by Tinyboss »

Okay, I made a very quick and dirty fix and uploaded it. Thanks for the report!

It actually was on_init instead of on_load in the first version. But apparently on_init only gets called once, ever, and so it's a bad place to put options like infinite_range. For now I've just duplicated on_init and on_load, just so it'll run. When I get time I'll do a proper fix.

Actually that whole mess of logic probably doesn't bear close scrutiny, since it's been poked and prodded and added onto, at the same time as I've been learning to make Factorio mods. It's due for a rewrite soon. But you're right about the short-circuiting.
billw
Long Handed Inserter
Long Handed Inserter
Posts: 67
Joined: Tue May 27, 2014 10:27 am
Contact:

Re: Eyedropper - An easier way to pick items from your inventory

Post by billw »

You could add an item called eye dropper that if it is in your hand will perform selection otherwise won't. People can have this as a short cut in their toolbelt then.
You could extend for other "tools" as well and turn the toolbelt into a set of tools!
e.g. Eyedropper for items, eye dropper for contents, refueller, rearmer, single click mark for deconstruct/cancel deconstruct (really want this one, trying to selection rectangle from distance on a single item is a pain) whatever else people can think of...

/edit of course if they stop moving too long the eyedropper gets replaced by an item, but its to quick to re-select something from toolbelt I don't think this would be a problem.
Tinyboss
Filter Inserter
Filter Inserter
Posts: 467
Joined: Sun Nov 16, 2014 12:11 pm
Contact:

Re: Eyedropper - An easier way to pick items from your inventory

Post by Tinyboss »

billw wrote:You could add an item called eye dropper that if it is in your hand will perform selection otherwise won't. People can have this as a short cut in their toolbelt then.
That is just perfect! (Well, middle-click would be perfect, but that's damn close.)

Okay, time to learn a little more about modding so I can put a new item in.

Thanks for the great idea!
GopherAtl
Fast Inserter
Fast Inserter
Posts: 177
Joined: Sat Jan 31, 2015 7:54 pm
Contact:

Re: Eyedropper - An easier way to pick items from your inventory

Post by GopherAtl »

I'd actually just make it not pick unless your hand is currently empty, rather than add an eyedropper object; if you're already holding something, it won't drop it, and you can just hit q to deselect if you want to use the eyedropper effect. So the worst harm of unintended selections is you fill an empty hand and have to tap q to put it away.
My Mods:
Nixie Tubes - numeric displays for your circuit networks!
Logistic Combinators - use logistics values in circuit logic! -
Autowire - automate red/green wire connections
billw
Long Handed Inserter
Long Handed Inserter
Posts: 67
Joined: Tue May 27, 2014 10:27 am
Contact:

Re: Eyedropper - An easier way to pick items from your inventory

Post by billw »

GopherAtl wrote:I'd actually just make it not pick unless your hand is currently empty, rather than add an eyedropper object; if you're already holding something, it won't drop it, and you can just hit q to deselect if you want to use the eyedropper effect. So the worst harm of unintended selections is you fill an empty hand and have to tap q to put it away.
Hmm, I normally don't like having stuff in my hand, if it worked with empty hand I would constantly be accidentally picking stuff up.
FYI I don't use this mod so I'm just going off the description and what I would like.
Tinyboss
Filter Inserter
Filter Inserter
Posts: 467
Joined: Sun Nov 16, 2014 12:11 pm
Contact:

Re: Eyedropper - An easier way to pick items from your inventory

Post by Tinyboss »

Hey guys, check the OP, I implemented billw's suggestion as a new mod called Picker. I think it works really well.
User avatar
ssilk
Global Moderator
Global Moderator
Posts: 12889
Joined: Tue Apr 16, 2013 10:35 pm
Contact:

Re: Eyedropper - An easier way to pick items from your inventory

Post by ssilk »

Would be nice, if such obsolete mods would be marked via reporting-function. That makes the moderation job much easier.
Cool suggestion: Eatable MOUSE-pointers.
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...
Post Reply

Return to “Mods”