Make an advanced powder toy mod in lua that adds a supernova which is only a one-use…
- User
Make an advanced powder toy mod in lua that adds a supernova which is only a one-use particle that when spawned. It'll release a lot of subatomic particle, creating a massive supernova explosion. With Interesting properties.
Example Lua Mod, (THIS IS ONLY AN EXAMPLE. MAKE YOUR OWN LUA SCRIPT):
local smfb = elements.allocate("smallfubomb", "smfb") elements.element(smfb, elements.element(elements.DEFAULT_PT_DEST)) elements.property(smfb, "Name", "SMFB") elements.property(smfb, "Description", "Small Mother F***ing bomb. VERY DESTRUCTIVE") elements.property(smfb, "Temperature", 273.15) elements.property(smfb, "HeatConduct", 255) elements.property(smfb, "Weight", 500) local function explosion(i,x,y,s,nt) for r in sim.neighbors(x,y,1,1) do if sim.partProperty(r, "type") ~= smfb then sim.partProperty(r, "temp", 10000) sim.pressure(x/4, y/4, sim.pressure(x/4, y/4) + 10) if sim.partProperty(i, "life") == 0 then sim.partProperty(i, "life", 301) end if math.random(0, math.random(1, 25)) == 0 then sim.partChangeType(r, elem.DEFAULT_PT_HYGN) end if math.random(0, 50) == 0 then sim.partProperty(r, "life", 0) sim.partChangeType(r, smfb) end if math.random(0, 100) == 0 then sim.partChangeType(r, elem.DEFAULT_PT_DEST) end if math.random(0, 50) == 0 then sim.partChangeType(r, elem.DEFAULT_PT_GBMB) end if math.random(0, 50) == 0 then sim.partProperty(r, "tmp2", 10000) sim.partProperty(r, "life", 1000) sim.partChangeType(r,elem.DEFAULT_PT_WARP) end local ix = math.random(sim.partProperty(r, "x") - 1, sim.partProperty(r, "x") + 1) local iy = math.random(sim.partProperty(r, "y") - 1, sim.partProperty(r, "y") + 1) sim.partProperty(i, "x", ix) sim.partProperty(i, "y", iy) end if sim.partProperty(i, "life") < 61 and sim.partProperty(i, "life") ~= 0 then sim.partChangeType(r, elem.DEFAULT_PT_BOMB) end sim.partProperty(i, "vx", math.random(sim.partProperty(i, "vx") - 5, sim.partProperty(i, "vx") + 5)) sim.partProperty(i, "vy", math.random(sim.partProperty(i, "vy") - 5, sim.partProperty(i, "vy") + 5)) end end elements.property(smfb, "Update", explosion)These reference links are reference files:
https://github.com/The-Powder-Toy/The-Powder-Toy/raw/refs/heads/master/src/lua/TPTSTypes.cpp https://raw.githubusercontent.com/The-Powder-Toy/The-Powder-Toy/refs/heads/master/src/simulation/CoordStack.h https://github.com/The-Powder-Toy/The-Powder-Toy/raw/refs/heads/master/src/simulation/elements/BCLN.cpp
- Assistant