Help...(Please noone laugh at me)

  • batman333
    25th Sep 2014 Member 0 Permalink

    Thanks, You are the best!!!

  • boxmein
    25th Sep 2014 Former Staff 0 Permalink
    I just have to plug this: http://boxmein.net/tptelements/#lua
    edit: fixing errors soon.
    Edited once by boxmein. Last: 25th Sep 2014
  • batman333
    28th Sep 2014 Member 0 Permalink

    How would I make a metal conduct faster?

  • QuentinADay
    28th Sep 2014 Member 0 Permalink

    this has been brought up in the past and from what i remember they said it wasn't really possible. but im not really sure about it 

  • batman333
    28th Sep 2014 Member 0 Permalink

    IS there a way I could make molten something mix with molten something else to make something else altogether

    (e.g. Molten brick + Molten stone = Molten concrete)

    Edited once by batman333. Last: 28th Sep 2014
  • jward212
    29th Sep 2014 Member 0 Permalink

    this should work but might spam you with errors see if i could do better

    function something(i,x,y,s,n)
    ctype = tpt.get_property("ctype", x + math.random(-1,1), y + math.random(-1,1))

    ctype1 = tpt.get_property("ctype", x, y)
    if ctype == tpt.el.stne.id and ctype1 == tpt.el.brck.id then

    tpt.set_property('ctype', tpt.el.cnct.id, x, y)
    end
    end
    tpt.element_func(something,tpt.el.lava.id)

  • QuentinADay
    29th Sep 2014 Member 0 Permalink

    yes this time i made it work off its ctype because all of lava is the same exept for its ctype (what element was melted): 

     

    function molten(i,x,y,s,n)
    type = tpt.get_property("ctype", x, y)
    if type == tpt.el.brck.id then
    tpt.parts[i].type = tpt.el.cnct.id
    end
    end
    tpt.element_func(molten,tpt.el.lava.id)

    function molten(i,x,y,s,n)
    type = tpt.get_property("ctype", x, y)
    if type == tpt.el.stne.id then
    tpt.parts[i].type = tpt.el.cnct.id
    end
    end
    tpt.element_func(molten,tpt.el.lava.id)

     

    i think mine is a bit better then jward212's (no offence) because mine will not produce errors

    Edited 2 times by QuentinADay. Last: 28th Sep 2014
  • jward212
    29th Sep 2014 Member 0 Permalink

    function molten(i,x,y,s,n)
    ctype = tpt.get_property("ctype", x, y)
    if ctype == tpt.el.brck.id then
    sim.partChangeType(i, tpt.el.cnct.id) 
    end
    end
    tpt.element_func(molten,tpt.el.lava.id)

    function molten(i,x,y,s,n)
    ctype = tpt.get_property("ctype", x, y)
    if ctype == tpt.el.stne.id then
    sim.partChangeType(i, tpt.el.cnct.id) 
    end
    end
    tpt.element_func(molten,tpt.el.lava.id)

    who's better now :P :)

    I admit defeat, not that there was ever a battle:\

    Edited once by jward212. Last: 28th Sep 2014
  • jacob1
    29th Sep 2014 Developer 0 Permalink

    jward212:

    who's better now :P :)


    I am

    local function molten(i,x,y,s,n)
    local function ignore(i,x,y)
    local ctype1,ctype2 = tpt.get_property("ctype", x, y),tpt.get_property("ctype", x+math.random(-1,1), y+math.random(-1,1))
    if ctype1 == tpt.el.brck.id and ctype2 == tpt.el.stne.id then
    sim.partChangeType(i, tpt.el.cnct.id)
    end
    end
    pcall(ignore, i, x, y)
    end
    tpt.element_func(molten,tpt.el.lava.id)


    Edit: reading the original question this is totally wrong ... let me fix this
    Edit2: ok! I just used pcall to ignore the errors ... I can't find a replacement for tpt.get_property that doesn't error unless i'm being stupid and missing something obvious.
    Edit3: now with less randomness
    Edited 3 times by jacob1. Last: 28th Sep 2014
  • QuentinADay
    29th Sep 2014 Member 0 Permalink

    jacob1, for some reason you can't do: tpt.get_property("ctype", x + math.random(-1,1), y+ math.random(-1,1)) without errors. You have to do this: tpt.get_property("ctype", x, y)  I have no clue why...