[Mod] Thermal Foundation Fluids

  • alice_loona_OT12
    22nd Sep 2019 Member 0 Permalink

    This mod attempts to port the Thermal Foundation (a Minecraft mod) liquids into The Powder Toy

     

    
    local function heat()
        tpt.set_property("temp", 10000, "BLZP")
        tpt.set_property("temp", 0, "GLDC")
    end
    tpt.register_step(heat)
     
    elements.allocate('OVVO', 'BLZP')
    elements.element(elements.OVVO_PT_BLZP, elements.element(elements.DEFAULT_PT_GLOW))
    elements.property(elements.OVVO_PT_BLZP, 'Name', 'BLZP')
    elements.property(elements.OVVO_PT_BLZP, 'Description', 'Blazing Pyrotheum ("This is actually worse than lava. You monster.")')
    elements.property(elements.OVVO_PT_BLZP, 'Color', '0xfdba2a')
    elements.property(elements.OVVO_PT_BLZP, 'MenuSection', '7')
    elements.property(elements.OVVO_PT_BLZP, 'HeatConduct', '511')
    local g = function(i, x, y, s, n)
    --Update Function
    end
    tpt.element_func(g, tpt.element('BLZP'))
     
    local function heat()
    end
    tpt.register_step(heat)
     
    elements.allocate('OVVO', 'GLDC')
    elements.element(elements.OVVO_PT_GLDC, elements.element(elements.DEFAULT_PT_GLOW))
    elements.property(elements.OVVO_PT_GLDC, 'Name', 'GLDC')
    elements.property(elements.OVVO_PT_GLDC, 'Description', 'Gelid Cryotheum ("This is also worse than lava, except cold. You yeti.")')
    elements.property(elements.OVVO_PT_GLDC, 'Color', '0x22bdfb')
    elements.property(elements.OVVO_PT_GLDC, 'MenuSection', '7')
    elements.property(elements.OVVO_PT_GLDC, 'HeatConduct', '511')
    local g = function(i, x, y, s, n)
    --Update Function
    end
    tpt.element_func(g, tpt.element('GLDC'))
     
    elements.allocate('OVVO', 'EGLS')
    elements.element(elements.OVVO_PT_EGLS, elements.element(elements.DEFAULT_PT_GLOW))
    elements.property(elements.OVVO_PT_EGLS, 'Name', 'EGLS')
    elements.property(elements.OVVO_PT_EGLS, 'Description', 'Energized Glowstone (LAGGY) ("So that"s how those formations occur! It all makes nonsense now!")')
    elements.property(elements.OVVO_PT_EGLS, 'Color', '0xfebb2b')
    elements.property(elements.OVVO_PT_EGLS, 'MenuSection', '7')
    elements.property(elements.OVVO_PT_EGLS, 'Gravity', '-0.15000000596046')
    
    local g = function(i, x, y, s, n)
    --Update Function
    end
    tpt.element_func(g, tpt.element('EGLS'))
    function signal(i,x,y,s,n)
        if math.random(1,500) < 12 then
            tpt.create(x + math.random(-1,1), y + math.random(-1,1), 'phot')
        end
    end
    tpt.element_func(signal,tpt.element('EGLS'))
    
    elements.allocate('OVVO', 'ZPHA')
    elements.element(elements.OVVO_PT_ZPHA, elements.element(elements.DEFAULT_PT_GLOW))
    elements.property(elements.OVVO_PT_ZPHA, 'Name', 'ZPHA')
    elements.property(elements.OVVO_PT_ZPHA, 'Description', 'Zephyrean aerotheum is the air elemental fluid. It would be obtained by melting aerotheum dust in any heat (no magma crucible), but this is TPT and there is no aerotheum dust with a high-temperature transition proeprty of Zephyrean Aerotheum in TPT yet. It is lighter than air and vertically flows up instead of down. It is currently unused.')
    elements.property(elements.OVVO_PT_ZPHA, 'Color', '0xada87b')
    elements.property(elements.OVVO_PT_ZPHA, 'MenuSection', '7')
    elements.property(elements.OVVO_PT_ZPHA, 'Gravity', '-0.15000000596046')
    
    elements.allocate('OVVO', 'TCTP')
    elements.element(elements.OVVO_PT_TCTP, elements.element(elements.DEFAULT_PT_GLOW))
    elements.property(elements.OVVO_PT_TCTP, 'Name', 'TCTP')
    elements.property(elements.OVVO_PT_TCTP, 'Description', 'Tectonic petrotheum is the earth elemental fluid. Blah blah, in TPT, no petrotheum dust or magma crucible. It is currently unused.')
    elements.property(elements.OVVO_PT_TCTP, 'Color', '0x2f231d')
    elements.property(elements.OVVO_PT_TCTP, 'MenuSection', '7')
    elements.property(elements.OVVO_PT_TCTP, 'Gravity', '0.15000000696046')
    elements.property(elements.OVVO_PT_TCTP, 'Advection', '0.50000001192093')
    
    elements.allocate('OVVO', 'LQFC')
    elements.element(elements.OVVO_PT_LQFC, elements.element(elements.DEFAULT_PT_GLOW))
    elements.property(elements.OVVO_PT_LQFC, 'Name', 'LQFC')
    elements.property(elements.OVVO_PT_LQFC, 'Description', 'Liquifacted coal ("Liquifaction is salvation!")')
    elements.property(elements.OVVO_PT_LQFC, 'Color', '0x333333')
    elements.property(elements.OVVO_PT_LQFC, 'MenuSection', '7')
    elements.property(elements.OVVO_PT_LQFC, 'Gravity', '0.15000000596046')
    elements.property(elements.OVVO_PT_LQFC, 'Flammable', '125')
    
    elements.allocate('OVVO', 'DRST')
    elements.element(elements.OVVO_PT_DRST, elements.element(elements.DEFAULT_PT_GLOW))
    elements.property(elements.OVVO_PT_DRST, 'Name', 'DRST')
    elements.property(elements.OVVO_PT_DRST, 'Description', 'Destabilized Redstone (Laggy) ("Behold, the Redstone Revolution!") (Now in TPT with electricity instead) Oof framerate')
    elements.property(elements.OVVO_PT_DRST, 'Color', '0x7c0404')
    elements.property(elements.OVVO_PT_DRST, 'MenuSection', '7')
    
    local g = function(i, x, y, s, n)
    --Update Function
    end
    tpt.element_func(g, tpt.element('DRST'))
    function signal(i,x,y,s,n)
        if math.random(1,500) < 51 then
            tpt.create(x + math.random(-1,1), y + math.random(-1,1), 'sprk')
        end
    end
    tpt.element_func(signal,tpt.element('DRST'))
    
    

    Some of these are unused in TPT (i.e. Aerotheum,Petrotheum.) Enderium isn't in here.


    More mods here b/c rate limit and I'm in a hurry to make these mods public + TPT Forum hates my activity 


    Bleach


    local ble = elem.allocate("OwO", "BLCH") elem.element(ble, elem.element(elem.DEFAULT_PT_GLOW)) elem.property(ble, "Name", "BLCH") elem.property(ble, "Description", "A dangerous substance that Kills organic matter") elem.property(ble, "Color", 0xDDEEBF) elem.property(ble, "Flammable", 0) elem.property(ble, "MenuSection", elem.SC_LIQUIDS) elem.property(ble, "Properties", elem.PROP_DEADLY) local function bleached(i, x, y, s, nt) local r = sim.partID(math.random(x-1, x+1), math.random(y-1, y+1)) if r ~= nil then local rtype = sim.partProperty(r, "type") if rtype == elem.DEFAULT_PT_ACID then sim.partKill(r) elseif rtype == elem.DEFAULT_PT_LIFE then sim.partKill(r) elseif rtype == elem.DEFAULT_PT_PLNT then sim.partKill(r) elseif rtype == elem.DEFAULT_PT_VINE then sim.partKill(r) elseif rtype == elem.DEFAULT_PT_VIRS then sim.partKill(r) elseif rtype == elem.DEFAULT_PT_WOOD then sim.partKill(r) elseif rtype == elem.DEFAULT_PT_YEST then sim.partKill(r) elseif rtype == elem.DEFAULT_PT_DYST then sim.partKill(r) else return(0) end end end elements.property(ble, "Update", bleached)

    Destroying stuff quickly

    
    local oww1 = elem.allocate("YEET", "OWW1")
    local oww2 = elem.allocate("YEET", "OWW2")
    local oww3 = elem.allocate("YEET", "OWW3")
    
    elements.element(oww1, elements.element(elements.DEFAULT_PT_GUN))
    elements.property(oww1, "Name", "OWW1")
    elements.property(oww1, "Description", "OWW1", "Owch!")
    elements.property(oww1, "Colour", 0xFEEF36)
    elements.property(oww1, "MenuSection", elem.SC_EXPLOSIVES)
    elements.property(oww1, "Explosive", 0)
    elements.property(oww1, "Flammable", 0)
    elements.property(oww1, "Weight", 50)
    elements.property(oww1, "HotAir", 50000)
    elements.property(oww1, "Advection", -1)
    elements.property(oww1, "Temperature", 150373.15)
    elements.property(oww1, "Loss", 1)
    elements.property(oww1, "AirLoss", 1)
    elements.property(oww1, "AirDrag", 1)
    elements.property(oww1, "Collision", 100)
    elements.property(oww1, "Gravity", 0.01)
    elements.property(oww1, "Diffusion", 1)
    elements.property(oww1, "LowPressureTransition", elements.DEFAULT_PT_LIGH)
    elements.property(oww1, "LowTemperature", 50)
    elements.property(oww1, "LowTemperatureTransition", elements.DEFAULT_PT_DEST)
    
    local function graphics1(i, colr, colg, colb) 
        return 1,ren.FIRE_ADD,235,130,195,209,255,245,235,105
    end
    elements.property(oww1, "Graphics", graphics1)
    
    
    elements.element(oww2, elements.element(elements.DEFAULT_PT_GUN))
    elements.property(oww2, "Name", "OWW2")
    elements.property(oww2, "Description", "OWW2", "Owwch!!")
    elements.property(oww2, "Colour", 0xFEEF36)
    elements.property(oww2, "MenuSection", elem.SC_EXPLOSIVES)
    elements.property(oww2, "Explosive", 2)
    elements.property(oww2, "Flammable", 9999)
    elements.property(oww2, "Weight", 50)
    elements.property(oww2, "HotAir", 50000000)
    elements.property(oww2, "Advection", -10)
    elements.property(oww2, "Temperature", 150373.15)
    elements.property(oww2, "Loss", 2)
    elements.property(oww2, "AirLoss", 2)
    elements.property(oww2, "AirDrag", 1)
    elements.property(oww2, "Collision", 200)
    elements.property(oww2, "Gravity", 0.01)
    elements.property(oww2, "Diffusion", 2)
    elements.property(oww2, "LowPressureTransition", elements.DEFAULT_PT_LIGH)
    elements.property(oww2, "LowTemperature", 50)
    elements.property(oww2, "LowTemperatureTransition", elements.DEFAULT_PT_DEST)
    
    local function graphics1(i, colr, colg, colb) 
        return 1,ren.FIRE_ADD,235,130,195,209,255,245,235,105
    end
    elements.property(oww2, "Graphics", graphics1)
    
    elements.element(oww3, elements.element(elements.DEFAULT_PT_GUN))
    elements.property(oww3, "Name", "OWW3")
    elements.property(oww3, "Description", "OWW3", "oof")
    elements.property(oww3, "Colour", 0xFEEF36)
    elements.property(oww3, "MenuSection", elem.SC_EXPLOSIVES)
    elements.property(oww3, "Explosive", 2)
    elements.property(oww3, "Flammable", 9999)
    elements.property(oww3, "Weight", 50)
    elements.property(oww3, "HotAir", 500000000000)
    elements.property(oww3, "Advection", -1000)
    elements.property(oww3, "Temperature", 15037315.15)
    elements.property(oww3, "Loss", 256)
    elements.property(oww3, "AirLoss", 8)
    elements.property(oww3, "AirDrag", 2)
    elements.property(oww3, "Collision", 400)
    elements.property(oww3, "Gravity", 0.01)
    elements.property(oww3, "Diffusion", 4)
    elements.property(oww3, "LowPressureTransition", elements.DEFAULT_PT_LIGH)
    elements.property(oww3, "LowTemperature", 50)
    elements.property(oww3, "LowTemperatureTransition", elements.DEFAULT_PT_DEST)
    
    local function graphics1(i, colr, colg, colb) 
        return 1,ren.FIRE_ADD,235,130,195,209,255,245,235,105
    end
    elements.property(oww3, "Graphics", graphics1)
    
    
    
    

    Useless flame dust

    
    tpt.el.lava.heat = 1995.1500244141
    
    elements.allocate('OWO', 'BLAV')
    elements.element(elements.OWO_PT_BLAV, elements.element(elements.DEFAULT_PT_GLOW))
    elements.property(elements.OWO_PT_BLAV, 'Name', 'BLAV')
    elements.property(elements.OWO_PT_BLAV, 'Description', 'Burning lava. See "burning dust".')
    elements.property(elements.OWO_PT_BLAV, 'Temperature', 3273.1500244141)
    elements.property(elements.OWO_PT_BLAV, 'Color', 14700560)
    elements.property(elements.OWO_PT_BLAV, 'MenuSection', '7')
    
    local g = function(i, x, y, s, n)
    --Update Function
    end
    tpt.element_func(g, tpt.element('BLAV'))
    function signal(i,x,y,s,n)
        if math.random(1,10) == 1 then
            tpt.create(x, y-1, 'fire')
    	elseif math.random(1,10) == 2 then
    	    tpt.create(x, y-1, 'fire')
        end
    end
    tpt.element_func(signal,tpt.element('BLAV'))
    
    
    elements.allocate('OWO', 'BDST')
    elements.element(elements.OWO_PT_BDST, elements.element(elements.DEFAULT_PT_STNE))
    elements.property(elements.OWO_PT_BDST, 'Name', 'BDST')
    elements.property(elements.OWO_PT_BDST, 'Description', 'Burning dust. It-s exactly what-s on the tin.')
    elements.property(elements.OWO_PT_BDST, 'Color', '0x7f6c6c')
    elements.property(elements.OWO_PT_BDST, 'Temperature', 293.1500244141)
    elements.property(elements.OWO_PT_BDST, 'MenuSection', '5')
    
    local g = function(i, x, y, s, n)
    --Update Function
    end
    tpt.element_func(g, tpt.element('BDST'))
    function signal(i,x,y,s,n)
        if math.random(1,10) == 1 then
            tpt.create(x, y-1, 'fire')
    	elseif math.random(1,10) == 2 then
    	    tpt.create(x, y-1, 'fire')
        end
    end
    tpt.element_func(signal,tpt.element('BDST'))
    
    
    elements.property(elements.OWO_PT_BLAV, 'LowTemperature', 696.15002441406)
    elements.property(elements.OWO_PT_BLAV, 'LowTemperatureTransition', elements.OWO_PT_BDST)
    
    
    elements.property(elements.OWO_PT_BDST, 'HighTemperature', 696.15002441406)
    elements.property(elements.OWO_PT_BDST, 'HighTemperatureTransition', elements.OWO_PT_BLAV)
    
    
    Edited 4 times by JohnSmith777779. Last: 23rd Sep 2019
  • regk
    9th Sep 2022 Member 0 Permalink

    please can you put this into a lua folder and put it on github? i just dont know how to put this into tpt.

  • RebMiami
    9th Sep 2022 Member 0 Permalink

    The code for BLCH looks a little bit wacky. Maybe try making a table of element IDs it can destroy and checking if the type of the particle it's touching is one of them?

     

    Not a full implementation, but that would probably look something like this:

    -- table of bleachable elements
    local bleachable = {
    [elem.DEFAULT_PT_ACID] = true,
      [elem.DEFAULT_PT_LIFE] = true,
      [elem.DEFAULT_PT_WOOD] = true,
    }

    -- put something like this in the update function
    local rtype = sim.partProperty(r, "type")
    if bleachable[rtype] then
    sim.partKill(r)
    end

    Edited once by RebMiami. Last: 9th Sep 2022
  • username90000
    10th Sep 2022 Member 0 Permalink

    why we dont have hbm ntm mod in tpt

  • Inventor70
    3rd Oct 2022 Member 0 Permalink

    @Holly866_668

    I will make it for u if u haven't done that yet.

    Can I have permission?

    Edit: I finished making it!

    Edited 2 times by Inventor70. Last: 4th Oct 2022