Raised This Month: $ Target: $400
 0% 

[ANY] Dissolve Ragdolls


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
GoRRageBoy
BANNED
Join Date: Jul 2011
Old 07-02-2011 , 08:50   [ANY] Dissolve Ragdolls
Reply With Quote #1

Here's a bit of code you can stick in any plugin to make players ragdolls dissolve on death.

Tested and working in
● Team Fortress 2 (though I'm sure this will work in other games such as DoD:S, L4D, L4D2, CS:S)

Known bugs with this code
● [TF2] When playing as a Spy using the Dead Ringer, when you feign death, your fake corpse doesn't dissolve. (I'm not exactly sure how to fix this, so if someone could help me out, that'd be swell)

Here's what the effect looks like ingame (TF2). The dissolving uses the effect from Half Life 2 for when you dissolve someone using those energy ball things.
[IMG]http://img824.**************/img824/2194/dissolvescout.th.png[/IMG]
(Click thumbnail to view fullsize image)


PHP Code:
public OnPluginStart()
{
    
HookEvent("player_death"Event_PlayerDeathPostEventHookMode_Post);
}


public 
Action:Event_PlayerDeathPost(Handle:event, const String:name[], bool:dontBroadcast)
{
    new 
victim GetClientOfUserId(GetEventInt(event"userid"));

    if (
IsValidEntity(victim))
    {
        
CreateTimer(0.1Timer_DissolveRagdollany:victim);
    }
    return 
Plugin_Continue;
}


public 
Action:Timer_DissolveRagdoll(Handle:timerany:victim)
{
    new 
ragdoll GetEntPropEnt(victimProp_Send"m_hRagdoll");

    if (
ragdoll != -1)
    {
        
DissolveRagdoll(ragdoll);
    }
}


DissolveRagdoll(ragdoll)
{
    new 
dissolver CreateEntityByName("env_entity_dissolver");

    if (
dissolver == -1)
    {
        return;
    }

    
DispatchKeyValue(dissolver"dissolvetype""0");
    
DispatchKeyValue(dissolver"magnitude""1");
    
DispatchKeyValue(dissolver"target""!activator");

    
AcceptEntityInput(dissolver"Dissolve"ragdoll);
    
AcceptEntityInput(dissolver"Kill");

    return;


Last edited by GoRRageBoy; 07-02-2011 at 21:43.
GoRRageBoy is offline
klausenbusk
AlliedModders Donor
Join Date: Jan 2011
Old 07-23-2011 , 07:11   Re: [ANY] Dissolve Ragdolls
Reply With Quote #2

Quote:
Originally Posted by miknew20 View Post
i dont know how to download it help D:
This are for plugin developer
klausenbusk is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 07-26-2011 , 05:45   Re: [ANY] Dissolve Ragdolls
Reply With Quote #3

Credits to L. Duke Dissolve (player ragdolls)
Bacardi is offline
GoRRageBoy
BANNED
Join Date: Jul 2011
Old 08-03-2011 , 04:39   Re: [ANY] Dissolve Ragdolls
Reply With Quote #4

Quote:
Originally Posted by Bacardi View Post
^-- No. Just no.

This code isn't from his plugin.
GoRRageBoy is offline
gameguysz
Member
Join Date: Aug 2011
Location: USA
Old 08-14-2011 , 19:47   Re: [ANY] Dissolve Ragdolls
Reply With Quote #5

Quote:
Originally Posted by miknew20 View Post
i know but how do i use the PHP code

Its not a PHP code its a actual code for a plugin that you can develop.
gameguysz is offline
GoRRageBoy
BANNED
Join Date: Jul 2011
Old 08-22-2011 , 02:22   Re: [ANY] Dissolve Ragdolls
Reply With Quote #6

So apparently we now have team-colored dissolving on weapons like the Righteous Bison, Cow Mangler 5000 and that new Engi weapon...uh...Short Circuit, I think.

Does anyone know how to change this dissolving code to use the team-colored dissolving?
GoRRageBoy is offline
FlaminSarge
Veteran Member
Join Date: Jul 2010
Old 09-26-2011 , 05:56   Re: [ANY] Dissolve Ragdolls
Reply With Quote #7

Probably set the dissolvetype to something else. Or set the death event's damagecustom to something.

This code looks awfully familiar.

Also, instead of passing victim in the timer, you should pass GetEventInt(event, "userid") and then within the Timer_DissolveRagdoll, client = GetClientOfUserId(userid), check if the client's valid and not 0, and then do the rest of the stuff.
__________________
Bread EOTL GunMettle Invasion Jungle Inferno 64-bit will break everything. Don't even ask.

All plugins: Randomizer/GiveWeapon, ModelManager, etc.
Post in plugin threads with questions.
Steam is for playing games.
You will be fed to javalia otherwise.
Psyduck likes replays.
FlaminSarge is offline
psychonic

BAFFLED
Join Date: May 2008
Old 09-26-2011 , 09:19   Re: [ANY] Dissolve Ragdolls
Reply With Quote #8

Have you tried just changing the dissolver's m_iTeamNum ?
psychonic is offline
FlaminSarge
Veteran Member
Join Date: Jul 2010
Old 09-27-2011 , 06:37   Re: [ANY] Dissolve Ragdolls
Reply With Quote #9

Doesn't seem to have any effect.
__________________
Bread EOTL GunMettle Invasion Jungle Inferno 64-bit will break everything. Don't even ask.

All plugins: Randomizer/GiveWeapon, ModelManager, etc.
Post in plugin threads with questions.
Steam is for playing games.
You will be fed to javalia otherwise.
Psyduck likes replays.
FlaminSarge is offline
GoRRageBoy
BANNED
Join Date: Jul 2011
Old 09-27-2011 , 19:49   Re: [ANY] Dissolve Ragdolls
Reply With Quote #10

Quote:
Originally Posted by FlaminSarge View Post
Probably set the dissolvetype to something else. Or set the death event's damagecustom to something.

This code looks awfully familiar.

Also, instead of passing victim in the timer, you should pass GetEventInt(event, "userid") and then within the Timer_DissolveRagdoll, client = GetClientOfUserId(userid), check if the client's valid and not 0, and then do the rest of the stuff.
It should look familiar. It's from your Give Weapon plugin.

I actually took the code from your plugin and turned it into it's own plugin.

However, as I stated above, Dead Ringer Spies are left wide open because their fake corpses don't dissolve and I can't figure out how to make that work.
GoRRageBoy is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 20:15.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode