this should work:
function something(i,x,y,s,n)
type = tpt.get_property("type", x + math.random(-1,1), y + math.random(-1,1))
if type == tpt.el.watr.id then
tpt.parts[i].type = tpt.el.pste.id
end
end
tpt.element_func(something,tpt.el.clst.id)
line 3 is the first element
line 7 is the second element
and line 4 is the resulting element
also if you do it the way i just did you might want to do this:
function something(i,x,y,s,n)
type = tpt.get_property("type", x + math.random(-1,1), y + math.random(-1,1))
if type == tpt.el.clst.id then
tpt.parts[i].type = tpt.el.pste.id
end
end
tpt.element_func(something,tpt.el.watr.id)
function something(i,x,y,s,n)
type = tpt.get_property("type", x + math.random(-1,1), y + math.random(-1,1))
if type == tpt.el.watr.id then
tpt.parts[i].type = tpt.el.pste.id
end
end
tpt.element_func(something,tpt.el.clst.id)
it makes it so not just one turns to pste but both turn to pste.
also you can name the function, I just use the element its for due to me being bad at making names :P
function pasteReaction(i,x,y,s,n)
type = tpt.get_property("type", x + math.random(-1,1), y + math.random(-1,1))
if type == tpt.el.watr.id then
tpt.parts[i].type = tpt.el.pste.id
end
end
tpt.element_func(pasteReaction,tpt.el.clst.id)
also if you want more than 1 product
function pasteReaction(i,x,y,s,n)
chance = math.random(-1,1) --1/3 chance of a single product
type = tpt.get_property("type", x + math.random(-1,1), y + chance)
if type == tpt.el.watr.id then
if chance == 1 then
tpt.parts[i].type = tpt.el.pste.id --first product pste
end
if chance == 0 then
tpt.parts[i].type = tpt.el.acid.id --second acid
end
if chance == -1 then
tpt.parts[i].type = tpt.el.thdr.id --third thdr
end
end
end
tpt.element_func(pasteReaction,tpt.el.clst.id)
wow slow typing and look how many comments...
wow i love how you added onto what i did it looks pretty good XD
btw you need one more "end" for it to work
No problem! :)
I always make these mistakes with out my lovly notepad++
lol i use sublime text 2 it works really well and i love it