How to create a fizzle effect in ttt

Whether we’re putting it in a swep or a concommand, I just need to know how to duplicate the effect the combine energy ball has on personnel in ttt.

I don’t know where to find any of the effects for it or anything.

You gotta use https://developer.valvesoftware.com/wiki/Env_entity_dissolver

Ok, cool. Can I call that on a player and how? would I just spawn the entity on a player’s position?

Don’t dissolve players, it will remove the entity too.
If you need the effect only, you will have to recreate it from scratch.

I need the whole thing, remove and all. I can make the weapon that’s going to spawn it. so that if it hits a player it kills them, waits a tick and then finds and fizzles the ragdoll… as long as I can figure out how to make it work at all. How would I call it on a regular entity?

You shouldn’t use it on a player, it will REMOVE the player object, making that person not being able to do anything, not even exit the game.

Yeah, yeah, the weapon that CALLS it is going to kill that player and then search for the ragdoll and fizzle that. I just need to know how to fizzle things at all so I can wire them together

Fair enough.

Here’s what I use to do this:



local dissolver = ents.Create( "env_entity_dissolver" )
		dissolver:SetPos( ent:GetPos() )
		dissolver:Spawn()
		dissolver:Activate()
		dissolver:SetKeyValue( "target", "cleanser_dissolve" )
		dissolver:SetKeyValue( "magnitude", 100 )
		dissolver:SetKeyValue( "dissolvetype", 0 )
		dissolver:Fire( "Dissolve" )
		dissolver:Remove()

Make sure to set targetname of the ragdoll to “cleanser_dissolve”.

So what does happen if I remove a player? in case I want to do it to someone out of spite?

[editline]23rd March 2014[/editline]

So if I wanted this function…


function corpse_remove(corpse)
	CORPSE.SetFound(corpse, false)
	if string.find(corpse:GetModel(), "zm_", 6, true) then
		corpse:Remove()
	elseif corpse.player_ragdoll then
		corpse:Remove()
	end
end

…to fizzle corpses I would change it to this?


function corpse_remove(corpse)
	CORPSE.SetFound(corpse, false)
	if string.find(corpse:GetModel(), "zm_", 6, true) then
		local dissolver = ents.Create( "env_entity_dissolver" )
			dissolver:SetPos( ent:GetPos() )
			dissolver:Spawn()
			dissolver:Activate()
			dissolver:SetKeyValue( corpse, "cleanser_dissolve" )
			dissolver:SetKeyValue( "magnitude", 100 )
			dissolver:SetKeyValue( "dissolvetype", 0 )
			dissolver:Fire( "Dissolve" )
			dissolver:Remove()
	elseif corpse.player_ragdoll then
		local dissolver = ents.Create( "env_entity_dissolver" )
			dissolver:SetPos( ent:GetPos() )
			dissolver:Spawn()
			dissolver:Activate()
			dissolver:SetKeyValue( corpse, "cleanser_dissolve" )
			dissolver:SetKeyValue( "magnitude", 100 )
			dissolver:SetKeyValue( "dissolvetype", 0 )
			dissolver:Fire( "Dissolve" )
			dissolver:Remove()
	end
end


To dissolve a player, make them take dissolve damage.



local info = DamageInfo( )
info:SetDamageType( DMG_DISSOLVE )
info:SetDamage( 999 )
info:SetAttacker( whoever )
info:SetInflictor( the thing )
target:TakeDamageInfo( info )


Works on npcs and players - use the dissolver entity for everything else.

Weeeell, that’s a ton easier for some applications… I’d still like to get this other thing working for bodies.

[editline]23rd March 2014[/editline]

Current code

[lua]function corpse_fizzle(corpse)
CORPSE.SetFound(corpse, false)
if string.find(corpse:GetModel(), “zm_”, 6, true) then
– corpse:Remove()
local dissolver = ents.Create( “env_entity_dissolver” )
dissolver:SetPos( ent:GetPos() )
dissolver:Spawn()
dissolver:Activate()
dissolver:SetKeyValue( “target”, corpse:GetName())
dissolver:SetKeyValue( “magnitude”, 100 )
dissolver:SetKeyValue( “dissolvetype”, 0 )
dissolver:Fire( “Dissolve” )
dissolver:Remove()

elseif corpse.player_ragdoll then

– corpse:Remove()
local dissolver = ents.Create( “env_entity_dissolver” )
dissolver:SetPos( ent:GetPos() )
dissolver:Spawn()
dissolver:Activate()
dissolver:SetKeyValue( “target”, corpse:GetName())
dissolver:SetKeyValue( “magnitude”, 100 )
dissolver:SetKeyValue( “dissolvetype”, 0 )
dissolver:Fire( “Dissolve” )
dissolver:Remove()

end

end[/lua]

[editline]23rd March 2014[/editline]

doesn’t work

or it does when remove is left open but only to remove things, so I must be fizzling wrong.

Current code with set name because I’m an idiot. Still doesn’t work though.
[lua]function corpse_fizzle(corpse)
CORPSE.SetFound(corpse, false)
if string.find(corpse:GetModel(), “zm_”, 6, true) then
– corpse:Remove()
corpse:SetName(“fizzled”)
local dissolver = ents.Create( “env_entity_dissolver” )
dissolver:SetPos( ent:GetPos() )
dissolver:Spawn()
dissolver:Activate()
dissolver:SetKeyValue( “target”, “fizzled”)
dissolver:SetKeyValue( “magnitude”, 100 )
dissolver:SetKeyValue( “dissolvetype”, 0 )
dissolver:Fire( “Dissolve” )
dissolver:Remove()

elseif corpse.player_ragdoll then

– corpse:Remove()
corpse:SetName(“fizzled”)
local dissolver = ents.Create( “env_entity_dissolver” )
dissolver:SetPos( ent:GetPos() )
dissolver:Spawn()
dissolver:Activate()
dissolver:SetKeyValue( “target”, “fizzled”)
dissolver:SetKeyValue( “magnitude”, 100 )
dissolver:SetKeyValue( “dissolvetype”, 0 )
dissolver:Fire( “Dissolve” )
dissolver:Remove()

end

end
[/lua]

Crap, What’s wrong here? I’m sure I’m close to getting it.

Update, The damage info route does not work for ttt.

bump

Please help me out here

If you’re targeting a player; then remove the dissolve:Remove( ) / put it into a timer.Simple( 0, … to have it run next frame. For some reason it won’t damage players if it gets removed the same frame. ( Explains all those close calls… )