Way to prolong the smoke effect?
I understand that the smoke is very demanding, but I was curious if there was a way to prolong the effect? It is cool seeing rooms fill with smoke, but I feel like it would be even COOLER if the smoke lasted more than a few seconds. Like seeing it billow out of doorways and into the sky like an actual fire would be amazing.
Troja replied to Way to prolong the smoke effect? May 12, 2021 @ 1:49:08 am PST
Troja replied to Way to prolong the smoke effect? May 12, 2021 @ 1:49:08 am PSTtake a look in the preinstalled mods there is a "smokegun" the description says configurable smoke effects!
Jarrod replied to Way to prolong the smoke effect? May 13, 2021 @ 5:19:53 pm PST
Jarrod replied to Way to prolong the smoke effect? May 13, 2021 @ 5:19:53 pm PSTIt affects the smoke coming out of the gun yes, but even still it doesn't prolong the smoke effect take a look in the preinstalled mods there is a "smokegun" the description says configurable smoke effects!
Troja replied to Way to prolong the smoke effect? May 13, 2021 @ 11:24:31 pm PST
Troja replied to Way to prolong the smoke effect? May 13, 2021 @ 11:24:31 pm PSTthen you need to find a mod for that i have no idea sry =§It affects the smoke coming out of the gun yes, but even still it doesn't prolong the smoke effect take a look in the preinstalled mods there is a "smokegun" the description says configurable smoke effects!
Jarrod replied to Way to prolong the smoke effect? May 14, 2021 @ 1:49:57 am PST
Jarrod replied to Way to prolong the smoke effect? May 14, 2021 @ 1:49:57 am PSTAny ideas for any mods? I can't find anything like it :(then you need to find a mod for that i have no idea sry =§ It affects the smoke coming out of the gun yes, but even still it doesn't prolong the smoke effect
Troja replied to Way to prolong the smoke effect? May 14, 2021 @ 2:22:30 am PST
Troja replied to Way to prolong the smoke effect? May 14, 2021 @ 2:22:30 am PSTno not rly sry what you want is a pretty specific request dont think many people would do something like that because it would destroy performance on a lager scale
Jarrod replied to Way to prolong the smoke effect? May 14, 2021 @ 7:34:06 pm PST
Jarrod replied to Way to prolong the smoke effect? May 14, 2021 @ 7:34:06 pm PSTYeah that's why I was hoping it'd be some .ini or console tweak, something I could easily change back if needed no not rly sry what you want is a pretty specific request dont think many people would do something like that because it would destroy performance on a lager scale
zaap replied to Way to prolong the smoke effect? May 14, 2021 @ 7:50:43 pm PST
zaap replied to Way to prolong the smoke effect? May 14, 2021 @ 7:50:43 pm PSTthere is a file in the game (Teardown\data\script) with wich you can edit exlposion fire and smoke or so i think i don't know lua but here it is: (if someone know what lines need to be edited you will have my eternal respect and love)
function rnd(mi, ma)
return math.random(1000)/1000*(ma-mi) + mi
end
function rndVec(t)
return Vec(rnd(-t, t), rnd(-t, t), rnd(-t, t))
end
explosionPos = Vec()
trails = {}
function trailsAdd(pos, vel, life, size, damp, gravity)
t = {}
t.pos = VecCopy(pos)
t.vel = VecAdd(Vec(0, vel*0.7, 0 ), rndVec(vel))
t.size = size
t.age = 0
t.damp = damp
t.gravity = gravity
t.life = rnd(life*0.5, life*1.5)
t.nextSpawn = 0
trails[#trails+1] = t
end
function trailsUpdate(dt)
for i=#trails,1,-1 do
local t = trails
t.vel[2] = t.vel[2] + t.gravity*dt
t.vel = VecScale(t.vel, t.damp)
t.pos = VecAdd(t.pos, VecScale(t.vel, dt))
t.age = t.age + dt
local q = 1.0 - t.age / t.life
if q > 0.1 then
local r = t.size * q + 0.05
local spawnRate = 0.8*r/VecLength(t.vel)
while t.nextSpawn < t.age do
local w = 0.8-q*0.5
local w2 = 0.9
local v = VecScale(t.vel, 0.25)
ParticleReset()
ParticleType("smoke")
ParticleColor(w, w*0.95, w*0.9, w2, w2*0.95, w2*0.9)
ParticleRadius(r)
ParticleAlpha(q, 0)
ParticleDrag(2.0)
SpawnParticle(t.pos, v, rnd(0.5, 2.0))
t.nextSpawn = t.nextSpawn + spawnRate
end
else
trails = trails[#trails]
trails[#trails] = nil
end
end
end
smoke = {}
smoke.age = 0
smoke.size = 0
smoke.life = 0
smoke.next = 0
smoke.vel = 0
smoke.gravity = 0
smoke.amount = 0
function smokeUpdate(pos, dt)
smoke.age = smoke.age + dt
if smoke.age < smoke.life then
local q = 1.0 - smoke.age / smoke.life
for i=1, smoke.amount*q do
local w = 0.8-q*0.6
local w2 = 1.0
local r = smoke.size*(0.5 + 0.5*q)
local v = VecAdd(Vec(0, 1*q+q*smoke.vel, 0), rndVec(1*q))
local p = VecAdd(pos, rndVec(r*0.3))
ParticleReset()
ParticleType("smoke")
ParticleColor(w, w*0.95, w*0.9, w2, w2*0.95, w2*0.9)
ParticleRadius(0.5*r, r)
ParticleGravity(rnd(0,smoke.gravity))
ParticleDrag(1.0)
ParticleAlpha(q, q, "constant", 0, 0.5)
SpawnParticle(p, v, rnd(3,5))
end
end
end
fire = {}
fire.age = 0
fire.life = 0
fire.size = 0
function fireUpdate(pos, dt)
fire.age = fire.age + dt
if fire.age < fire.life then
local q = 1.0 - fire.age / fire.life
for i=1, 16 do
local v = rndVec(fire.size*10*q)
local p = pos
local life = rnd(0.2, 0.7)
life = 0.5 + life*life*life * 1.5
ParticleReset()
ParticleColor(1, 0.6, 0.4, 1, 0.3, 0.2)
ParticleAlpha(1, 0)
ParticleRadius(fire.size*q, 0.5*fire.size*q)
ParticleGravity(1, rnd(1, 10))
ParticleDrag(0.6)
ParticleEmissive(rnd(2, 5), 0, "easeout")
ParticleTile(5)
SpawnParticle(p, v, life)
end
end
end
flash = {}
flash.age = 0
flash.life = 0
flash.intensity = 0
function flashTick(pos, dt)
flash.age = flash.age + dt
if flash.age < flash.life then
local q = 1.0 - flash.age / flash.life
PointLight(pos, 1, 0.5, 0.2, flash.intensity*q)
end
end
light = {}
light.age = 0
light.life = 0
light.intensity = 0
function lightTick(pos, dt)
light.age = light.age + dt
if light.age < light.life then
local q = 1.0 - light.age / light.life
local l = q * q
local p = VecAdd(pos, rndVec(0.5*l))
PointLight(p, 1, 0.4, 0.1, light.intensity*l)
end
end
function explosionSparks(count, vel)
for i=1, count do
local v = VecAdd(Vec(0, vel, 0 ), rndVec(rnd(vel*0.5, vel*1.5)))
local life = rnd(0, 1)
life = life*life * 5
ParticleReset()
ParticleEmissive(5, 0, "easeout")
ParticleGravity(-10)
ParticleRadius(0.03, 0.0, "easein")
ParticleColor(1, 0.4, 0.3)
ParticleTile(4)
SpawnParticle(explosionPos, v, life)
end
end
function explosionDebris(count, vel)
for i=1, count do
local r = rnd(0, 1)
life = 0.5 + r*r*r*3
r = (0.4 + 0.6*r*r*r)
local v = VecAdd(Vec(0, r*vel*0.5, 0), VecScale(rndVec(1), r*vel))
local radius = rnd(0.03, 0.05)
local w = rnd(0.2, 0.5)
ParticleReset()
ParticleColor(w, w, w)
ParticleAlpha(1)
ParticleGravity(-10)
ParticleRadius(radius, radius, "constant", 0, 0.2)
ParticleSticky(0.2)
ParticleStretch(0.0)
ParticleTile(6)
ParticleRotation(rnd(-20, 20), 0.0, "easeout")
SpawnParticle(explosionPos, v, life)
end
end
function explosionSmall(pos)
explosionPos = pos
explosionSparks(10, 2)
explosionDebris(25, 6)
trails = {}
for i=1, 8 do
trailsAdd(pos, 5, 0.4, 0.1, 0.99, -10)
end
flash.age = 0
flash.life = 0.1
flash.intensity = 200
light.age = 0
light.life = 0.8
light.intensity = 15
fire.age = 0
fire.life = 0.5
fire.size = 0.2
smoke.age = 0
smoke.life = 1
smoke.size = 0.5
smoke.vel = 1
smoke.gravity = 3
smoke.amount = 2
end
function explosionMedium(pos)
explosionPos = pos
explosionSparks(30, 3)
explosionDebris(50, 7)
trails = {}
for i=1, 16 do
trailsAdd(pos, 12, 0.4, 0.15, 0.97, -10)
end
flash.age = 0
flash.life = 0.2
flash.intensity = 500
light.age = 0
light.life = 1.0
light.intensity = 30
fire.age = 0
fire.life = 0.6
fire.size = 0.5
smoke.age = 0
smoke.life = 1.5
smoke.size = 0.7
smoke.vel = 1
smoke.gravity = 2
smoke.amount = 2
end
function explosionLarge(pos)
explosionPos = pos
explosionSparks(50, 5)
explosionDebris(100, 10)
trails = {}
for i=1, 8 do
trailsAdd(pos, 12, 0.5, 0.2, 0.97, -10)
end
flash.age = 0
flash.life = 0.4
flash.intensity = 1000
light.age = 0
light.life = 1.2
light.intensity = 50
fire.age = 0
fire.life = 0.7
fire.size = 0.8
smoke.age = 0
smoke.life = 3
smoke.size = 1.0
smoke.gravity = -1
smoke.vel = 8
smoke.amount = 6
--Sideways fast cloud
ParticleReset()
ParticleColor(0.8, 0.75, 0.7)
ParticleRadius(0.3, 1.0)
ParticleAlpha(1, 0, "easeout")
ParticleDrag(0.2)
for a=0, math.pi*2, 0.05 do
local x = math.cos(a)*1
local y = rnd(-0.1, 0.1)
local z = math.sin(a)*1
local d = VecNormalize(Vec(x, y, z))
SpawnParticle(VecAdd(pos, d), VecScale(d, rnd(8,12)), rnd(0.5, 1.5))
end
end
function tick(dt)
if HasKey("game.explosion") then
local strength = GetFloat("game.explosion.strength")
local pos = Vec(GetFloat("game.explosion.x"), GetFloat("game.explosion.y"), GetFloat("game.explosion.z"))
if strength >= 2 then
explosionLarge(pos)
elseif strength >= 1 then
explosionMedium(pos)
else
explosionSmall(pos)
end
ClearKey("game.explosion")
end
flashTick(explosionPos, dt)
lightTick(explosionPos, dt)
end
function update(dt)
trailsUpdate(dt)
fireUpdate(explosionPos, dt)
smokeUpdate(explosionPos, dt)
end
zaap replied to Way to prolong the smoke effect? May 14, 2021 @ 8:14:06 pm PST
zaap replied to Way to prolong the smoke effect? May 14, 2021 @ 8:14:06 pm PSTmy bad i think it just does explosion. i could be wrong.
zaap replied to Way to prolong the smoke effect? May 14, 2021 @ 9:26:54 pm PST
zaap replied to Way to prolong the smoke effect? May 14, 2021 @ 9:26:54 pm PSTwait im dumb just increase smoke.life you can also edit the smoke life of the smoke gun in mod\smokegun. but i didn't found a way to increase the smoke life of fire
zaap replied to Way to prolong the smoke effect? May 14, 2021 @ 9:33:25 pm PST
zaap replied to Way to prolong the smoke effect? May 14, 2021 @ 9:33:25 pm PSTi got an rtx 2060 and 50 smoke life seems fine on performance just do a backup of the files before you change anything to be safe.
zaap replied to Way to prolong the smoke effect? May 14, 2021 @ 9:37:09 pm PST
zaap replied to Way to prolong the smoke effect? May 14, 2021 @ 9:37:09 pm PSTps please do not edit :
smoke = {}
smoke.age = 0
smoke.size = 0
smoke.life = 0
smoke.next = 0
smoke.vel = 0
smoke.gravity = 0
smoke.amount = 0
edit those under
"function explosion" small, medium, large.
zaap replied to Way to prolong the smoke effect? May 14, 2021 @ 10:18:36 pm PST
zaap replied to Way to prolong the smoke effect? May 14, 2021 @ 10:18:36 pm PSTother guess for fire is script\winddust at the end there is a particle type smoke
(for i = 1, gSmokeParticles do
local life = 1.0)
that could be the life of smoke generated by fire testing it right now
Kweebsters replied to Way to prolong the smoke effect? May 14, 2021 @ 11:38:09 pm PST
Kweebsters replied to Way to prolong the smoke effect? May 14, 2021 @ 11:38:09 pm PSTany way to remove smoke?
Jarrod replied to Way to prolong the smoke effect? May 15, 2021 @ 6:32:21 pm PST
Jarrod replied to Way to prolong the smoke effect? May 15, 2021 @ 6:32:21 pm PSTuhh... there is a lot here, what am I changing? has anything worked for fire smoke? lol other guess for fire is script\winddust at the end there is a particle type smoke
(for i = 1, gSmokeParticles do
local life = 1.0)
that could be the life of smoke generated by fire testing it right now
zaap replied to Way to prolong the smoke effect? May 15, 2021 @ 10:27:26 pm PST
zaap replied to Way to prolong the smoke effect? May 15, 2021 @ 10:27:26 pm PSTuhh... there is a lot here, what am I changing? has anything worked for fire smoke? lol other guess for fire is script\winddust at the end there is a particle type smoke
(for i = 1, gSmokeParticles do
local life = 1.0)
that could be the life of smoke generated by fire testing it right now
apparently no but you can change basicly every thing else.
in script\explosion you can change those how you like:
function explosionSmall(pos)
[...]
flash.age = 0
flash.life = 0.1
flash.intensity = 200
light.age = 0
light.life = 0.8
light.intensity = 15
fire.age = 0
fire.life = 0.5
fire.size = 0.2
smoke.age = 0
smoke.life = 1
smoke.size = 0.5
smoke.vel = 1
smoke.gravity = 3
smoke.amount = 2
(its under the type of exlplosion: small medium and big)
don't change "age" it will lower the amount.
for the smoke gun you can also change the smoke.life amount. its located in the mod folder.
life reffer to the time smoke "lives" vel is velocity and age is the amount smoke has allready "lived" wich is why it should stay at 0.
if you put life = 30 smoke will not fade for 30sec.
But exlosion have a limit to smoke life. Im trying to find which line of code limits it.
be gentle with it don't put crazy numbers if you dont have good specs.
yes just put smoke.life = 0 any way to remove smoke?