Extremely Durable TTAN

  • QuentinADay
    23rd Oct 2014 Member 1 Permalink

    Makes TTAN Non-Meltable. It had a weakness to DEST so I made it so it would push DEST if it comes in contact with it. I also made it resistant to VIRS by making it create a soap particle if it comes in contact with it, then it deletes the soap particle afterward. 

     

    elements.property(elements.DEFAULT_PT_TTAN, "HeatConduct" , 0)
    elements.property(elements.DEFAULT_PT_TTAN, "Hardness" , 0)
    elements.property(elements.DEFAULT_PT_TTAN, "Weight" , 10000)
    function ttan1(i,x,y,s,n)
    local type = tpt.get_property("temp", x, y)
    if type > 300 then
    tpt.set_property("temp", -math.huge, x, y)
    end
    tpt.set_property("temp", -math.huge, x, y)
    local type = tpt.get_property("type", x + math.random(-3,3), y + math.random(-3,3))
    if type == tpt.el.dest.id then
    sim.gravMap(x/4, y/4, -256)
    end
    local type = tpt.get_property("type", x + math.random(-1,1), y + math.random(-1,1))
    if type == tpt.el.virs.id or type == tpt.el.vrss.id or type == tpt.el.vrsg.id then
    tpt.create(x + math.random(-1,1), y + math.random(-1,1), 'soap')
    end
    local rx,ry = x + math.random(-1,1), y + math.random(-1,1)
    local type = tpt.get_property("type", rx, ry)
    if type == tpt.el.soap.id then
    tpt.delete(rx, ry)
    end
    sim.can_move(elements.DEFAULT_PT_DEST, elements.DEFAULT_PT_TTAN, 0)
    end
    tpt.element_func(ttan1,tpt.el.ttan.id)

    Edited once by QuentinADay. Last: 24th Oct 2014
  • Michael238
    23rd Oct 2014 Member 0 Permalink

    In other words, you basically made a copy of DMND that can contain pressure. However, unlike DMND, ACID and CAUS will still chew through it.

  • FeynmanLogomaker
    23rd Oct 2014 Member 0 Permalink

    Still, that's a pretty good element.

  • QuentinADay
    23rd Oct 2014 Member 0 Permalink

    Actually I set the hardness to 0 meaning acid and caus do nothing to it

  • fireball5000
    23rd Oct 2014 Member 0 Permalink

    Very nice! The effect is really cool with DEST when you have gravity grid or fancy display mode on.

  • QuentinADay
    23rd Oct 2014 Member 0 Permalink

    Ya, that is my favorite effect too

  • jacob1
    23rd Oct 2014 Developer 0 Permalink
    Pretty cool how you try and make it immune to DEST :P

    I'd just suggest a few things. Don't name your variables "type", ever. That overwrites a lua function and if you have tptmp running it will just spam errors. If you really want to name it that you can make it a local variable (local type = tpt.get_property("temp", x, y)).

    Also, if you add this line, it will be even more resistant to DEST: sim.can_move(elements.DEFAULT_PT_DEST, elements.DEFAULT_PT_TTAN, 0). That prevents DEST from moving through TTAN.

    Also I suggest you remove the line about deleting the SOAP, since that actually causes it to delete whatever it to the upper right of the TTAN whenever it is near SOAP. Or, you could at least redo it like this (untested but will probably work?):
    local rx,ry = x + math.random(-1,1), y + math.random(-1,1)
    local type = tpt.get_property("type", rx, ry)
    if type == tpt.el.soap.id then
    tpt.delete(rx, ry)
    end


    Also why not post it on the new lua script server!
  • QuentinADay
    24th Oct 2014 Member 0 Permalink

    Thank you for all the suggestions Jacob1

  • jacob1
    24th Oct 2014 Developer 0 Permalink
    Yay the updated script is so much better and more resistant :D
    btw sim.can_move(elements.DEFAULT_PT_DEST, elements.DEFAULT_PT_TTAN, 0) only needs to be run once :P
  • QuentinADay
    24th Oct 2014 Member 0 Permalink

    I actually made an element that breaks it. Should I Add it just for Fun or does that defeat the purpose too much?

    Edited once by QuentinADay. Last: 24th Oct 2014