I don't know anything about the coding of TPT but if I were you I'd take a look at the code of CONV.
for (rx=-2; rx<3; rx++)<br/> for (ry=-2; ry<3; ry++)<br/> if (x+rx>=0 && y+ry>0 && x+rx {
r = pmap[y+ry][x+rx];
if (!r)
continue;
// if (((r&0xFF)==PT_FIRE || (r&0xFF)==PT_PLSM) && 1>(rand()%500))
// {
sim->create_part((r&0xFF), parts[r>>8].x, parts[r>>8].y, PT_VINE);
// ...
-- Create the element and copy properties from DUST
local VNER = elements.allocate("NUCULAR", "VNER")
elements.element(VNER, elements.element(elements.DEFAULT_PT_DUST))
elements.property(VNER, "Name", "VNER")
elements.property(VNER, "Description", "Viner, changes stuff into VINE.")
-- Create an update function for VNER
local function VNER_update(index, partx, party, space, nt)
-- Get the particle neighbours and iterate over them
for i in ipairs(simulation.partNeighbours(partx, party, 2)) do
-- Don't change other VNER particles
if simulation.partProperty(i, "type") != VNER then
simulation.partChangeType(i, elements.DEFAULT_PT_VINE)
end
end
end
-- Bind our update function to VNER so it gets called every
-- frame for every particle of VNER
tpt.element_func(VNER_update, VNER)