Why would that be a good reason to laugh at them, anyways?
How do you make an element that - when its life counts down to 0 - solidifies?
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.
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.
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
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)
K, thanks.