Scrap Mechanic

Scrap Mechanic

378 ratings
Electromagnets
4
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
Updated
1.774 MB
25 May, 2018 @ 5:33pm
4 May, 2022 @ 2:10pm
12 Change Notes ( view )

Subscribe to download
Electromagnets

Description
This mod adds an electromagnet.
When powered, it attracts other powered electromagnets. It's strength increases exponentially when the distance to the other electromagnet decreases.

If you have problems with magnets shooting in all directions, try to add more weight to them!

UPDATE 1:
  • The strength of an electromagnet can now be changed by powering it using an engine.
    This makes it easier to attract objects with a lower mass.

  • Added a polarity.
    The magnets now has 3 modes, which you can cycle through by pressing [E].
    - The mode with the magnet symbol attracts all other electromagnets.
    - The north mode with the 'N' symbol attracts all other electromagnets with a 'S' symbol, and repels all other electromagnets with a 'N' symbol.
    - The south mode with the 'S' symbol attracts all other electromagnets with a 'N' symbol, and repels all other electromagnets with a 'S' symbol.

  • Updated the icon to match the part.

UPDATE 2:
  • The visuals should now work for multiplayer. (Although I haven't tested this)

UPDATE 3:
  • Changed the physicsMaterial to reduce particles. (Thanks to kAN Gaming for showing me this)
  • When a magnet is connected to a Driver's Seat, it is powered when you enter the seat.
  • Updated the script to now work with Build 374. (7th July, 2018)

UPDATE 4:
  • Updated the script to now work with 0.4.0 (backwards compatible with at least 0.3.5)
  • Did some optimisations.

UPDATE 5:
  • Added support for survival mode engines

TODO:
  • Add engine sounds when the electromagnets are powered by engines.
  • Output some signal (I don't know what yet) to make it easier to let things hover.
  • Reduce collision sounds.
  • Update the icon to match the part.
  • Add a polarity. (I am not able to save the polarity at the moment)
  • Allow an engine to power the electromagnets.

Thanks to DasEtwas for letting me use his vector math code in the first version
Popular Discussions View All (1)
19
7 Jul, 2021 @ 9:48am
Mod ideas (NOT OFFICIAL)
Gibbs
330 Comments
AnreeNeo 15 Apr @ 7:40am 
TechnologicNick, hi, can you make it so that you can change the power of an electromagnet, like in a motor, and change the power using buttons or logic painted in a certain color?
TechnologicNick  [author] 25 Mar @ 12:29pm 
That used to be very slow years ago, I haven't looked into it since.
potatogoa 24 Mar @ 9:24am 
Can you make electromagnets attract metal?
TechnologicNick  [author] 3 Feb @ 1:46pm 
Scripted parts work as a multiplier of the strength. Logic input is a logic gate, switch, button, anything with an on or an off state.
Red_Claws 2 Feb @ 9:50am 
Can I use something else other then a engine, I recall it saying in the description in scrap mechanic "controlled by a engine or logic input" what kind of logic input
TechnologicNick  [author] 1 Feb @ 8:56am 
Read the description
Red_Claws 1 Feb @ 12:53am 
how do you change the strength?
TechnologicNick  [author] 4 Jan @ 6:00pm 
¯\_(ツ)_/¯
BraveCaperCat 4 Jan @ 3:34am 
my friend's game crashes if this mod is installed.
AnreeNeo 18 Oct, 2023 @ 7:51am 
some modders use colors in survival