Is there any way I can create a copy of an element like say fire then rename the copy of the element and change the propeties?
Read the wiki page
https://powdertoy.co.uk/Wiki/W/Lua_API:Elements.html
There is a specific example of creating an element with copied properties.
Okay thanks but i can't figure out how to set it's default life...
Do you know of any way i can have my script on the particle being created check to see if its life is set?
Cracker64's Lua script launcher's console output is telling me that "Partical Doesn't Exist"
that code snippet would go in the element update function for that element, not by itself.
local updatefunc = function(i,x,y,surround,nt)
if tpt.get_property("tmp",i) == 0 then
tpt.set_property("life",6400,i);
tpt.set_property("tmp",1,i);
end
end
tpt.element_func( updatefunc , elements.PT_YOUR_ELEMENT)
Can i get some more help i'm very new to Lua, here is my code.
local myNewElement = elements.allocate("MOD", "SUN")
elements.element(elements.MOD_PT_SUN, elements.element(elements.DEFAULT_PT_EMBR))
elements.property(elements.MOD_PT_SUN, "Name", "SUN")
elements.property(elements.MOD_PT_SUN, "Description", "Sun")
elements.property(elements.MOD_PT_SUN, "Gravity", "0")
elements.property(elements.MOD_PT_SUN, "Falldown", "0")
elements.property(elements.MOD_PT_SUN, "Temperature", "9000")
elements.property(elements.MOD_PT_SUN, "Colour", 0xFFFE9E19)
I need to get my Element to have life when created
EDIT: I solved the life problem, now i need to have a sparkle effect like EMBR
ask boxmein