Page 1 of 2

[0.11.x] Magnet

Posted: Mon Jun 16, 2014 4:37 am
by Schmendrick
Extremely simple mod, mainly created "just because."

Adds a new item, the magnet, crafted from a steel bar, a copper cable, and a battery. While held in hand, player picks up all items in a 16-tile radius. Basically, the "f" key on steroids.
magnetmp.jpg
magnetmp.jpg (216.4 KiB) Viewed 25099 times
Edit: fixed error when item(s) on ground were removed, even when player's inventory was too full to take it.

Changelog:
  • v1.1: magnet radius starts small, increases over about a second and a half to max radius. This should mitigate messiness when rearranging the magnet in inventory, or upon accidental selection.
  • v1.2: magnet radius is round.See post below for download; the download in this post is still the square one.
  • v1.2.1: magnet radius is round, fixed name compliance for 0.10.7
  • v1.3.1: works in multiplayer (probably won't in pre-0.11.x, old mod included for 0.10.x players)
  • v1.3.2: fixed bug where players who logged out with a magnet in hand kept sucking up items
  • v2.0.0: updated for 0.14. Square version removed.

Re: [0.9.8 +] Magnet

Posted: Mon Jun 16, 2014 7:33 am
by Vitduo
Very useful in battles for biters with mods DyTech and F-mod.
Thanks!

Re: [0.9.8 +] Magnet

Posted: Mon Jun 16, 2014 8:53 pm
by Schmendrick
Cleaned up a little; added English localization info and moved it to the logistics tab (with belts and splitters).

Re: [0.9.8 +] Magnet

Posted: Tue Jun 24, 2014 8:02 pm
by Schmendrick
Version of the magnet with a round radius instead of a square one.
magnetround.jpg
magnetround.jpg (340.73 KiB) Viewed 27282 times
Edit: removed "magnetround.zip" during fix for 0.10.7, made round magnet standard.

Re: [0.9.8 +] Magnet

Posted: Tue Jun 24, 2014 8:40 pm
by Rahjital
This will come useful when I accidentally destroy a fully laden steel chest again. xD I would just prefer the radius to be a bit smaller so that I wouldn't drain the entire factory of resources when trying to clean up. xD

By the way, if this works under 0.10.1, you might want to change the headline of the topic not to put people off. ;)

Re: [0.10.x, 0.9.8] Magnet

Posted: Tue Jun 24, 2014 8:47 pm
by Schmendrick
Well, you can keep the radius small if you "let go" of the magnet and pick it up again (which is the other reason I chose to make the radius ramp up), but you could also permanently lower the max radius by editing the file, there is a conveniently labeled "magnetmax" variable right at the top of control.lua.

I could also rewrite it so there are a few different magnet sizes, if there is interest in such a thing.

Also yes, thank you for the note on the thread title. I actually intended to change it while I was updating the first post but forgot. :oops:

Re: [0.10.x, 0.9.8] Magnet

Posted: Tue Jun 24, 2014 8:53 pm
by Rahjital
I'll just set the initial and max radius the same so that it behaves like an F key with a larger radius. I'm a bit too used to it to learn a second system, I'm afraid.

Different magnet sizes would actually be a pretty nice thing to have. Ideally there would be a smart magnet with customizable radius, but I might be asking for too much here. :)

Re: [0.10.x, 0.9.8] Magnet

Posted: Fri Jun 27, 2014 6:49 am
by CreeperDaReeper
Getting an error with the round magnet version.
Error

Re: [0.10.x, 0.9.8] Magnet

Posted: Fri Jun 27, 2014 7:25 am
by hoho
Rahjital wrote:Different magnet sizes would actually be a pretty nice thing to have. Ideally there would be a smart magnet with customizable radius, but I might be asking for too much here. :)
What about having the radius increase the more a person clicks the button in a row without clicking any other key?

E.g player stands in one place and clicks on F (or whatever key they have bound to it) and it picks up stuff from non-magnet range. Every other click of F done within at most one second since last click increases the radius 1.5x.


Having multiple magnets seems like a huge waste of inventory space.

Re: [0.10.x, 0.9.8] Magnet

Posted: Fri Jun 27, 2014 8:57 am
by Schmendrick
CreeperDaReeper wrote:Getting an error with the round magnet version.
Error
Rename the .zip file to "magnet" instead of "magnetround" maybe? If you unzip it the directory name is simply "magnet," I just renamed the .zip file for the upload.

Re: [0.10.x, 0.9.8] Magnet

Posted: Sat Jun 28, 2014 3:03 pm
by MtNak
Thanks! :) Very useful!

Re: [0.10.x, 0.9.8] Magnet

Posted: Thu Aug 14, 2014 1:56 pm
by cube
Hi, There is a future bug in 0.10.7, because the mod name in info.json (Magnet) doesn't match the filename (magnet) and __magnet__ inside.
https://forums.factorio.com/forum/vie ... =14&t=5364

Re: [0.10.x, 0.9.8] Magnet

Posted: Thu Aug 14, 2014 8:47 pm
by Schmendrick
Fixed.

Re: [0.10.x, 0.9.8] Magnet

Posted: Thu Aug 14, 2014 9:21 pm
by Lone_Player
Hello,

1. Thank you for this very useful mod, it save´s a lot of time, when u have to clean up the floor.

2. Factorio 10.6 + magnet_1.2.1.zip = Error Path _magnet_/graphics/magnet.png does not match any mod.

Solved = Rename magnet_1.2.1.zip = magnet.zip = Working

Re: [0.10.x, 0.9.8] Magnet

Posted: Thu Aug 14, 2014 9:24 pm
by Rseding91
Lone_Player wrote:Hello,

1. Thank you for this very useful mod, it save´s a lot of time, when u have to clean up the floor.

2. Factorio 10.6 + magnet_1.2.1.zip = Error Path _magnet_/graphics/magnet.png does not match any mod.

Solved = Rename magnet_1.2.1.zip = magnet.zip = Working
I don't think the mod needs to be renamed (to include the version number) until 0.10.7 is out :)

Re: [0.10.x, 0.9.8] Magnet

Posted: Thu Aug 14, 2014 10:32 pm
by Schmendrick
Aw, dammit. So much for being proactive about being proactive. :roll:

Re: [0.10.x, 0.9.8] Magnet

Posted: Sat Dec 20, 2014 7:12 pm
by Schmendrick
Proper update for multiplayer.

Re: [0.10.x, 0.9.8] Magnet

Posted: Sat Dec 20, 2014 8:47 pm
by AlphaRaptor
Schmendrick wrote:Proper update for multiplayer.
AWESOME WOHO , another Mod for MP , isnt that Awesome ?

I like mods like this , this makes the Gameplay easier :lol:

Re: [0.11.x] Magnet

Posted: Sat Dec 20, 2014 10:21 pm
by Rahjital
With the new 0.11 features, it would be nice if one of the smaller magnets was a part of power armour.

Re: [0.11.x] Magnet

Posted: Sat Dec 20, 2014 10:47 pm
by Schmendrick
Always on???