Videogamer555
Videogamer555
1 / 0
11th Jan 2012
11th Jan 2012
This nuke will detonate realitically, complete with a photon burst (commonly called "nuclear flash") when used with the Lua code in the comments section. These hot "IR" photons will set fire almost instantly to places far from the blast.

Comments

  • OmegaSupreme
    OmegaSupreme
    13th Jan 2012
    You are just too cool dude!
  • Videogamer555
    Videogamer555
    11th Jan 2012
    Copy the script below and paste it into your autorun.lua file to enable this nuke to explode realistically (complete with the heat/light "flash" and a hot fireball made of PLSM that expands with the shockwave). Side effects of this script are: NEUT immediately converts to PHOT when NEUT touches the surrounding air so NEUT can NOT be used outside of a nuclear bomb (sorry couldn't find any other way of making TPT distinguish between standalone NEUT and NEUT generated from nuclear reactions). Another side effect is there's significant lag when there's lots of NEUT from the nuke detonation. This means the bomb appears to detonate slowly in a "jerky" manner and then later speeds up. Again, sorry I don't know of any way to make my script run more efficiently. The script is the text below: function photnuke(i,x,y,s,n) istouchingair=0 for yoff = -1,1 do for xoff = -1,1 do elemtype=tpt.get_property("type",x+xoff,y+yoff) if elemtype==0 then istouchingair=1 end end end if istouchingair==1 then tpt.set_property("type","phot",i) tpt.set_property("ctype",0x3FFC0000,i) tpt.set_property("life",10000,i) tpt.set_property("vx",tpt.get_property("vx",i)*40,i) tpt.set_property("vy",tpt.get_property("vy",i)*40,i) end end tpt.element_func(photnuke,tpt.el.neut.id) function metlplsm(i,x,y,s,n) if tpt.get_property("ctype",i)==tpt.el.metl.id and tpt.get_property("temp",i)>8000 then tpt.set_property("type","plsm",i) tpt.set_property("life",150,i) end end tpt.element_func(metlplsm,tpt.el.lava.id)