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
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)
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
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:\
jward212:
who's better now :P :)
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)
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...