Magnesium and related stuff

  • Videogamer555
    6th Jan 2012 Member 0 Permalink
    I made a script to convert BMTL into MGSM (magnesium), and BRMT into MGMP (magnesium powder). MGSM burns slow and quite hot (about 3000celsius). MGMP burns extremely fast and extremely hot (over 5000celsius). Under pressure MGSM will break into MGMP (just like BMTL used to break into BRMT). The magnesium materials have been put into the explosives menu section because of their dangerous nature. Keep in mind also that lighting MGMP is easy enough to do with ordinary FIRE, but solid MGSM as in reality is quite hard to light so you must use PLSM or the flame from burning hydrogen to light it (this is because it must be at least 800 degrees C before it responds to any FIRE or PLSM, and the normal PLSM in the menu is well above this temperaturek and the FIRE from burning HYGN is also well above this temperature though not as hot as the PLSM). To light either MGSM or MGMP without an open flame you must raise their temperature to 3000 degrees C (slightly only cooler than the flame temperature of the actual burning magnesium) which means you must have a VERY powerful heat source.

    As you know, water will not put out magnesium fires in real life, and I made it the same here. Like in real life, TPT forms of water have been made in my script now to break down into HYGN and OXYG when heated above a certain point. This highly flammable gas mixture will burn and prevent the magnesium fire from going out. You can't put out magnesium fires with a CO2 fire in real life for the same reason (it breaks down under intense heating) to form carbon and oxygen (BCOL and OXYG in TPT, using my script).

    Because powdered magnesium is so reactive it will react and dissolve in water to form BASE (in real life the base is magnesium hydroxide) and HYGN. BASE is just a renaming and recoloring of SOAP (in fact in real life a variety of soaps are basic on the pH scale).

    ACID has had its update function modified in a way that it now reacts with BASE. ACID+BASE=SLTW (this is true in real life that an acid and a base will react together to form water and a dissolved salt even if it isn't "table salt" NaCl).

    ACID now reacts with MGSM and MGMP in a unique way. It realistically forms SALT and HYGN gas (assuming the ACID is HCl, in real life HCl reacted with Mg creates MgCl2 and H2).

    So now magnesium and magnesium powder and all the realistic reactions it should have exist in TPT.

    The Lua code for this is in the box below. To use this, copy and paste it into notepad and save the text file, then rename the text file you just created to autorun.lua and make sure it's in the same folder as Powder.exe. Then just run the program and start experimenting with magnesium.

    math.randomseed(os.time())
    function magn_update(i, x, y, s, n)
    nexta = tpt.get_property("type", x+math.random(-1, 1), y+math.random(-1, 1))
    nextb = tpt.get_property("temp", i)
    if ((nexta == tpt.el.plsm.id or nexta == tpt.el.fire.id or nexta == tpt.el.lava.id) and nextb >= 800) or nextb >= 3000 then
    tpt.parts[i].type = tpt.el.plsm.id
    tpt.parts[i].life = 150
    tpt.parts[i].temp = 3370
    end
    end
    tpt.element_func(magn_update, tpt.el.bmtl.id)

    function magpowder_disolve(i, x, y, s, n)
    next = tpt.get_property("type", x+math.random(-1, 1), y+math.random(-1, 1))
    if next == tpt.el.watr.id or next == tpt.el.dstw.id or next == tpt.el.sltw.id then
    randnum = math.random(1, 10)
    if randnum == 10 then
    tpt.parts[i].type = 0
    end
    end
    end
    tpt.element_func(magpowder_disolve, tpt.el.brmt.id)

    function water_split(i, x, y, s, n)
    if tpt.get_property("type", x+math.random(-1, 1), y+math.random(-1, 1)) == tpt.el.brmt.id then
    randnum = math.random(0, 1)
    if randnum == 0 then
    tpt.parts[i].type = tpt.el.hygn.id
    else
    tpt.parts[i].type = tpt.el.soap.id
    end
    end
    if tpt.get_property("temp", i) >= 1800 then
    randnum = math.random(0, 1)
    if randnum == 0 then
    tpt.parts[i].type = tpt.el.hygn.id
    else
    tpt.parts[i].type = tpt.el.oxyg.id
    end
    end
    end
    tpt.element_func(water_split, tpt.el.watr.id)
    tpt.element_func(water_split, tpt.el.dstw.id)
    tpt.element_func(water_split, tpt.el.sltw.id)
    tpt.element_func(water_split, tpt.el.wtrv.id)

    function CO2_split(i, x, y, s, n)
    if tpt.get_property("temp", i) >= 1800 then
    randnum = math.random(0, 1)
    if randnum == 0 then
    tpt.parts[i].type = tpt.el.bcol.id
    else
    tpt.parts[i].type = tpt.el.oxyg.id
    end
    end
    end
    tpt.element_func(CO2_split, tpt.el.co2.id)

    function acid_base_neutralize(i, x, y, s, n)
    for xpos =-1,1 do
    for ypos = -1,1 do
    elemtype=tpt.get_property("type",x+xpos,y+ypos)
    if elemtype == tpt.el.soap.id then
    tpt.set_property("type","sltw",i)
    tpt.set_property("type","sltw",x+xpos,y+ypos)
    elseif elemtype == tpt.el.bmtl.id or elemtype == tpt.el.brmt.id then
    tpt.set_property("type","salt",i)
    tpt.set_property("type","hygn",x+xpos,y+ypos)
    end
    end
    end
    end
    tpt.element_func(acid_base_neutralize, tpt.el.acid.id)


    tpt.eltransition.bmtl.tempHighValue=3000
    tpt.eltransition.bmtl.tempHighType=tpt.el.bmtl.id
    tpt.el.bmtl.menusection=3
    tpt.el.bmtl.color=0xdddddd
    tpt.el.bmtl.description="Magnesium. A flammable metal, it burns very hot but also requires significant heat to ignite."
    tpt.el.bmtl.name="MGSM"

    tpt.eltransition.brmt.tempHighValue=3000
    tpt.eltransition.brmt.tempHighType=tpt.el.plsm.id
    tpt.el.brmt.flammable=9999
    tpt.el.brmt.menusection=3
    tpt.el.brmt.color=0xbbbbbb
    tpt.el.brmt.description="Magnesium Powder. It's much easier to ignite than MGSM and also burns hotter."
    tpt.el.brmt.name="MGMP"

    tpt.el.soap.color=0x00ff00
    tpt.el.soap.description="Base. Neutralizes ACID to create SLTW."
    tpt.el.soap.name="BASE"
  • limelier
    6th Jan 2012 Member 0 Permalink
    "tpt.el.soap.color=0x00ff00
    tpt.el.soap.description="Base. Neutralizes ACID to create SLTW."
    tpt.el.soap.name="BASE""

    icwutudiddar
  • Videogamer555
    6th Jan 2012 Member 0 Permalink
    What are you talking about?
  • ArtMaster
    6th Jan 2012 Banned 0 Permalink
    This post is hidden because the user is banned
  • Videogamer555
    6th Jan 2012 Member 0 Permalink
    I used the code box to hold the code.
  • Electro40
    11th Nov 2017 Member 0 Permalink

    Magnesium has a reaction with DRIC...

    Look here: https://youtu.be/bNOol7Nh07Y?t=1m55s

     

    Edit: Plus, the code isn't working. (The element showed up in the menu "Powders" and it dissappeared in 0.01 second or lower.)

    Edited once by Electro40. Last: 11th Nov 2017
  • TPT_PL
    11th Nov 2017 Member 0 Permalink
    NECROPOTENCE!
  • Electro40
    12th Nov 2017 Member 0 Permalink

    @TPT_PL (View Post)

     Whats your problem? i just didn't see the date

  • Potbelly
    17th Nov 2017 Banned 0 Permalink
    This post is hidden because the user is banned