Help...(Please noone laugh at me)

  • batman333
    29th Sep 2014 Member 0 Permalink

    Nope (Just zinc and copper)

  • Darthan
    29th Sep 2014 Member 0 Permalink

    If someone laughed at you, I would laugh at them, because I have no idea what lua is.

  • FeynmanLogomaker
    29th Sep 2014 Member 0 Permalink
    @Darthan (View Post)
    It's a programming language embedded in TPT, you can use it to modify game behaviour.


    Why would that be a good reason to laugh at them, anyways?

  • NorthMustang
    14th Oct 2014 Member 0 Permalink

    How do you make an element that - when its life counts down to 0 - solidifies?

  • FeynmanLogomaker
    14th Oct 2014 Member 0 Permalink

    You would probably want to have two different elements, one a solid form of another, and write the update function to change between the two when needed.

  • NorthMustang
    14th Oct 2014 Member 0 Permalink

    But how is the reaction scripted? I cant seem to find a source on any site that will tell me ALL of the scripting language for TPT, and if anyone does decide to give me the script for this, please don't write it in any of this C++ crap that I can't use in my NOTEPAD scripting.

  • FeynmanLogomaker
    14th Oct 2014 Member 0 Permalink

    First off, you may want to get a better text editor than Notepad if you plan on doing any big projects.. I use SciTE, but it's a matter of personal preference.


     


    Anyhow, once you create both elements, you'd do something like this:


     


    function f(i, x, y, s, n) -- If you have an update function already, just add this code to it
    if tpt.get_property("life", i) == 0 then
    tpt.set_property("type", "element2", i)
    end
    end
    tpt.element_func(f, id_of_element1)

     


    Remember to set the PROP_LIFE_DEC property for your element, and to make sure it's created with some life above 0

    Edited 5 times by FeynmanLogomaker. Last: 14th Oct 2014
  • NorthMustang
    14th Oct 2014 Member 0 Permalink

    Ok here is my element and your suggestion:

    elements.element(elements.JWARD_PT_FOML, elements.element(elements.DEFAULT_PT_GEL))
    elements.property(elements.JWARD_PT_FOML, "Name", "FOML")
    elements.property(elements.JWARD_PT_FOML, "Description", "Liquid Foam. Turns to a solid when placed. (unless constantly cooled)")
    elements.property(elements.JWARD_PT_FOML, "Colour", 0xFFBDB293)
    elements.property(elements.JWARD_PT_FOML, "MenuSection", 7)
    elements.property(elements.JWARD_PT_FOML, "Gravity", 2.50)
    elements.property(elements.JWARD_PT_FOML, "Flammable", 0)
    elements.property(elements.JWARD_PT_FOML, "Explosive", 0)
    elements.property(elements.JWARD_PT_FOML, "Loss", 0)
    elements.property(elements.JWARD_PT_FOML, "Advection", 0)
    elements.property(elements.JWARD_PT_FOML, "Weight", 0)
    elements.property(elements.JWARD_PT_FOML, "Advection", 0)
    elements.property(elements.JWARD_PT_FOML, "Falldown", 2)
    elements.property(elements.JWARD_PT_FOML, "Hardness", 0)
    elements.property(elements.JWARD_PT_FOML, "State", ST_liquid)
    function pasteReaction(i,x,y,s,n)
    chance = math.random(-1,1)
    type = tpt.get_property("type", x + math.random(-1,1), y + chance)
    if type == tpt.el.watr.id then
    tpt.parts[i].type = (elements.JWARD_PT_FOML)
    end
    end
    tpt.element_func(pasteReaction,tpt.el.dust.id)

    --solid foam
    local SOLID FOAM = elements.allocate("JWARD", "FOMS")
    elements.element(elements.JWARD_PT_FOMS, elements.element(elements.DEFAULT_PT_GEL))
    elements.property(elements.JWARD_PT_FOMS, "Name", "FOMS")
    elements.property(elements.JWARD_PT_FOMS, "Description", "Solid Foam. Burn to remove.")
    elements.property(elements.JWARD_PT_FOMS, "Colour", 0xFF968D75)
    elements.property(elements.JWARD_PT_FOMS, "MenuSection", 9)
    elements.property(elements.JWARD_PT_FOMS, "Gravity", 0)
    elements.property(elements.JWARD_PT_FOMS, "Flammable", 10)
    elements.property(elements.JWARD_PT_FOMS, "Explosive", 0)
    elements.property(elements.JWARD_PT_FOMS, "Loss", 0)
    elements.property(elements.JWARD_PT_FOMS, "Advection", 0)
    elements.property(elements.JWARD_PT_FOMS, "Weight", 1000000000)
    elements.property(elements.JWARD_PT_FOMS, "Advection", 0)
    elements.property(elements.JWARD_PT_FOMS, "Falldown", 0)
    elements.property(elements.JWARD_PT_FOMS, "Hardness", 0)
    elements.property(elements.JWARD_PT_FOMS, "State", ST_Solid)
    function f(i, x, y, s, n)
    if tpt.get_property("life", i) == 0 then
    tpt.set_property("type", "FOMS", i)
    end
    end
    tpt.element_func(f, id_of_FOML)

  • jward212
    14th Oct 2014 Member 0 Permalink

    you can change all the JWARDs to what ever you want if consistant

     

    and you just add this to ur elements.property area

     

    elements.property(elements.JWARD_PT_FOML, "Properties", elem.PROP_LIFE_DEC)

     

    p.s any text editor that highlights lua is good

  • NorthMustang
    15th Oct 2014 Member 0 Permalink

    K, thanks.

    Edited 2 times by NorthMustang. Last: 15th Oct 2014