Raised This Month: $51 Target: $400
 12% 

[L4D2] Restore Survivor Death Animations (UPDATED 03-29-2015)


Post New Thread Reply   
 
Thread Tools Display Modes
DeathChaos25
Senior Member
Join Date: Jan 2014
Location: Puerto Rico
Old 12-15-2014 , 19:35   Re: [L4D2] Restore Survivor Death Animations
Reply With Quote #41

Quote:
Originally Posted by bazrael View Post
In the latest version, I always see discontinuous death animation like Francis in demostration video. I barely see fluent animation like other survivors in demo video. Why?
That's really not the plugin's fault, but rather, the fault of server ticks.

You could probably cut down a few miliseconds off of the death timer and see if that helps, I tried reducing the timer because this also bothers me, yet at the same time I want the whole Death Animation to play out completely without having to cut it short, I've a lot of free time now since I'm done with my college finals and stuff, so I finally have some much needed free time.

Quote:
Originally Posted by LoneBat View Post
This can also be used with Restore Ragdolls, right?
Yes, 100%
__________________
DeathChaos25 is offline
LoneBat
Senior Member
Join Date: Dec 2013
Location: China
Old 12-22-2014 , 09:18   Re: [L4D2] Restore Survivor Death Animations
Reply With Quote #42

But in the moment of death suffered continuous attacks, death animation will repeat, can not really dead.
LoneBat is offline
DeathChaos25
Senior Member
Join Date: Jan 2014
Location: Puerto Rico
Old 02-24-2015 , 11:42   Re: [L4D2] Restore Survivor Death Animations
Reply With Quote #43

Updated

IF YOU DO NOT USE RAGDOLL DEATHS THIS UPDATE IS NOT NECESSARY AS IT CHANGES NOTHING

Quote:
Originally Posted by bazrael View Post
In the latest version, I always see discontinuous death animation like Francis in demostration video. I barely see fluent animation like other survivors in demo video. Why?
Fixed, with the adjustment to the timer, ragdoll deaths should now be fluent 100% of the time, no exceptions, if you come across one that isn't let me know to adjust the timer again.

Also, remember how L4D1 survivors don't mourn each other in the L4D2 set because of an unknown bug, correct?

A little something I'll be working on that will hopefully fix this.

As you can see, this is fixed on Zoey's side by FakeZoey, now I just need to implement it for Bill, Francis and Louis.
__________________

Last edited by DeathChaos25; 02-24-2015 at 11:43.
DeathChaos25 is offline
Sev
Veteran Member
Join Date: May 2010
Old 02-24-2015 , 12:51   Re: [L4D2] Restore Survivor Death Animations
Reply With Quote #44

Pretty neat.

Always wanted to see a fix for that bug.

I assume the fix would apply to both the real Zoey (Linux exclusive) and your new FakeZoey?
Sev is offline
DeathChaos25
Senior Member
Join Date: Jan 2014
Location: Puerto Rico
Old 02-24-2015 , 14:31   Re: [L4D2] Restore Survivor Death Animations
Reply With Quote #45

Quote:
Originally Posted by Sev View Post
Pretty neat.

Always wanted to see a fix for that bug.

I assume the fix would apply to both the real Zoey (Linux exclusive) and your new FakeZoey?
With the way it's implemented, it won't matter and should work equally everywhere.

This was actually done by Machine

Basically, it takes into account the character model of the speaker, then using the static death models, we scan them to find what character model they themselves posses.

Once we know who saw who it's just a simple matter of making scene processor play out the needed mourns.
__________________
DeathChaos25 is offline
DeathChaos25
Senior Member
Join Date: Jan 2014
Location: Puerto Rico
Old 03-25-2015 , 18:32   Re: [L4D2] Restore Survivor Death Animations (UPDATED 03-25-2015 PLUGIN REWRITE)
Reply With Quote #46

UPDATED!

Code:
Version 1.4    03-25-2015
 - Complete Plugin Rewrite, this plugin no longer uses shitty damage detection!
 - This plugin will now ALWAYS 100% Guarantee work as intended, this is done by the new check
 - The plugin now instead of predicting when you die, it will instead check for clients
   to see if they are in the dying animation instead, this means now players will only
   die when the game decides it and this thus removes any and all faulty damage detections
IF ANYONE HAS PREVIOUSLY DOWNLOADED THE PLUGIN PLEASE DOWNLOAD THE NEWEST VERSION.

The plugin should now work 100% as advertised with absolutely no issues whatsoever under any circumstances (if so, please report, as there should be no problems now)

On previews versions, the plugin used damage detection to predict client deaths, and as such was prone to errors, such as clients being killed when they weren't supposed to die, or clients not dying when they were supposed to and being stuck in the animations as a result.

The plugin has now been coded to work with the animations themselves, meaning no damage detection is involved, the plugin no longer decides when you die, the game does, so if you enter the death animation state and you die, it was the game's fault meaning you were meant to die (THE PLUGIN HAS NO WAY OF FORCING THE ANIMATIONS)

Enjoy!

Small notes for those who use ragdoll deaths, a future update is planned once some issues with defibfix are worked out, this update would allow users to DEFIB SURVIVORS WHO DIED A RAGDOLL DEATH

EDIT : TO the 3 people that had downloaded, please redownload as there was a small oversight where Ellis' Death Animation had the same index as Louis's Walking animations with certain weapons and would die as a result, this oversight has beem fixed by adding a model check and matching the animation with the survivor's model, also now survivors are not allowed to take ANY actions at all when in the dying animation.
__________________

Last edited by DeathChaos25; 03-25-2015 at 23:26.
DeathChaos25 is offline
DeathChaos25
Senior Member
Join Date: Jan 2014
Location: Puerto Rico
Old 03-26-2015 , 18:34   Re: [L4D2] Restore Survivor Death Animations (UPDATED 03-25-2015 PLUGIN REWRITE)
Reply With Quote #47

For anyone who wants to slay clients and force them to die with the death animations;
look for your slay.sp in your sourcemod/scripting/playercommands folder, and replace the contents of it with this
PHP Code:
/**
* vim: set ts=4 :
* =============================================================================
* SourceMod Basefuncommands Plugin
* Provides slay functionality
*
* SourceMod (C)2004-2008 AlliedModders LLC.  All rights reserved.
* =============================================================================
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, version 3.0, as published by the
* Free Software Foundation.

* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License along with
* this program.  If not, see <http://www.gnu.org/licenses/>.
*
* As a special exception, AlliedModders LLC gives you permission to link the
* code of this program (as well as its derivative works) to "Half-Life 2," the
* "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software
* by the Valve Corporation.  You must obey the GNU General Public License in
* all respects for all other code used.  Additionally, AlliedModders LLC grants
* this exception to all derivative works.  AlliedModders LLC defines further
* exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007),
* or <http://www.sourcemod.net/license.php>.
*
* Version: $Id$
*/

#include <sdktools>

PerformSlay(clienttarget)
{
    
LogAction(clienttarget"\"%L\" slayed \"%L\""clienttarget);
    
SetEntProp(targetProp_Send"m_iHealth"1);
    
SetEntProp(targetProp_Send"m_currentReviveCount"2);
    
SetEntProp(targetProp_Send"m_bIsOnThirdStrike"1);
    
SetEntProp(targetProp_Send"m_isGoingToDie"1);
    
    
DealDamage(target100);
}

DisplaySlayMenu(client)
{
    
Menu menu CreateMenu(MenuHandler_Slay);
    
    
char title[100];
    
Format(titlesizeof(title), "%T:""Slay player"client);
    
menu.SetTitle(title);
    
menu.ExitBackButton true;
    
    
AddTargetsToMenu(menuclienttruetrue);
    
    
menu.Display(clientMENU_TIME_FOREVER);
}

public 
AdminMenu_Slay(Handle:topmenu
TopMenuAction:action,
TopMenuObject:object_id,
param,
String:buffer[],
maxlength)
{
    if (
action == TopMenuAction_DisplayOption)
    {
        
Format(buffermaxlength"%T""Slay player"param);
    }
    else if (
action == TopMenuAction_SelectOption)
    {
        
DisplaySlayMenu(param);
    }
}

public 
MenuHandler_Slay(Menu menuMenuAction actionparam1param2)
{
    if (
action == MenuAction_End)
    {
        
delete menu;
    }
    else if (
action == MenuAction_Cancel)
    {
        if (
param2 == MenuCancel_ExitBack && hTopMenu != null)
        {
            
hTopMenu.Display(param1TopMenuPosition_LastCategory);
        }
    }
    else if (
action == MenuAction_Select)
    {
        
char info[32];
        
int useridtarget;
        
        
menu.GetItem(param2infosizeof(info));
        
userid StringToInt(info);
        
        if ((
target GetClientOfUserId(userid)) == 0)
        {
            
PrintToChat(param1"[SM] %t""Player no longer available");
        }
        else if (!
CanUserTarget(param1target))
        {
            
PrintToChat(param1"[SM] %t""Unable to target");
        }
        else if (!
IsPlayerAlive(target))
        {
            
ReplyToCommand(param1"[SM] %t""Player has since died");
        }
        else
        {
            
decl String:name[32];
            
GetClientName(targetnamesizeof(name));
            
PerformSlay(param1target);
            
ShowActivity2(param1"[SM] ""%t""Slayed target""_s"name);
        }
        
        
DisplaySlayMenu(param1);
    }
}

public 
Action:Command_Slay(clientargs)
{
    if (
args 1)
    {
        
ReplyToCommand(client"[SM] Usage: sm_slay <#userid|name>");
        return 
Plugin_Handled;
    }
    
    
decl String:arg[65];
    
GetCmdArg(1argsizeof(arg));
    
    
decl String:target_name[MAX_TARGET_LENGTH];
    
decl target_list[MAXPLAYERS], target_countbool:tn_is_ml;
    
    if ((
target_count ProcessTargetString(
    
arg,
    
client,
    
target_list,
    
MAXPLAYERS,
    
COMMAND_FILTER_ALIVE,
    
target_name,
    
sizeof(target_name),
    
tn_is_ml)) <= 0)
    {
        
ReplyToTargetError(clienttarget_count);
        return 
Plugin_Handled;
    }
    
    for (new 
0target_counti++)
    {
        
PerformSlay(clienttarget_list[i]);
    }
    
    if (
tn_is_ml)
    {
        
ShowActivity2(client"[SM] ""%t""Slayed target"target_name);
    }
    else
    {
        
ShowActivity2(client"[SM] ""%t""Slayed target""_s"target_name);
    }
    
    return 
Plugin_Handled;
}

#define DMG_GENERIC            0
#define DMG_CRUSH            (1 << 0)
#define DMG_BULLET            (1 << 1)
#define DMG_SLASH            (1 << 2)
#define DMG_BURN            (1 << 3)
#define DMG_VEHICLE            (1 << 4)
#define DMG_FALL            (1 << 5)
#define DMG_BLAST            (1 << 6)
#define DMG_CLUB            (1 << 7)
#define DMG_SHOCK            (1 << 8)
#define DMG_SONIC            (1 << 9)
#define DMG_ENERGYBEAM            (1 << 10)
#define DMG_PREVENT_PHYSICS_FORCE    (1 << 11)
#define DMG_NEVERGIB            (1 << 12)
#define DMG_ALWAYSGIB            (1 << 13)
#define DMG_DROWN            (1 << 14)
#define DMG_TIMEBASED            (DMG_PARALYZE | DMG_NERVEGAS | DMG_POISON | DMG_RADIATION | DMG_DROWNRECOVER | DMG_ACID | DMG_SLOWBURN)
#define DMG_PARALYZE            (1 << 15)
#define DMG_NERVEGAS            (1 << 16)
#define DMG_POISON            (1 << 17)
#define DMG_RADIATION            (1 << 18)
#define DMG_DROWNRECOVER        (1 << 19)
#define DMG_ACID            (1 << 20)
#define DMG_SLOWBURN            (1 << 21)
#define DMG_REMOVENORAGDOLL        (1 << 22)
#define DMG_PHYSGUN            (1 << 23)
#define DMG_PLASMA            (1 << 24)
#define DMG_AIRBOAT            (1 << 25)
#define DMG_DISSOLVE            (1 << 26)
#define DMG_BLAST_SURFACE        (1 << 27)
#define DMG_DIRECT            (1 << 28)
#define DMG_BUCKSHOT            (1 << 29)

DealDamage(victim,damage,attacker=0,dmg_type=DMG_GENERIC,String:weapon[]="")
{
    if(
victim>&& IsValidEdict(victim) && IsClientInGame(victim) && IsPlayerAlive(victim) && damage>0)
    {
        new 
String:dmg_str[16];
        
IntToString(damage,dmg_str,16);
        new 
String:dmg_type_str[32];
        
IntToString(dmg_type,dmg_type_str,32);
        new 
pointHurt=CreateEntityByName("point_hurt");
        if(
pointHurt)
        {
            
DispatchKeyValue(victim,"targetname","war3_hurtme");
            
DispatchKeyValue(pointHurt,"DamageTarget","war3_hurtme");
            
DispatchKeyValue(pointHurt,"Damage",dmg_str);
            
DispatchKeyValue(pointHurt,"DamageType",dmg_type_str);
            if(!
StrEqual(weapon,""))
            {
                
DispatchKeyValue(pointHurt,"classname",weapon);
            }
            
DispatchSpawn(pointHurt);
            
AcceptEntityInput(pointHurt,"Hurt",(attacker>0)?attacker:-1);
            
DispatchKeyValue(pointHurt,"classname","point_hurt");
            
DispatchKeyValue(victim,"targetname","war3_donthurtme");
            
RemoveEdict(pointHurt);
        }
    }

Save your Slay.sp, and recompile your playercommands plugin (DO NOT COMPILE SLAY!), and you should be golden!

I'll provide a precompiled version just in case.
Attached Files
File Type: sp Get Plugin or Get Source (slay.sp - 138 views - 6.5 KB)
File Type: smx playercommands.smx (11.7 KB, 182 views)
__________________

Last edited by DeathChaos25; 03-26-2015 at 18:36.
DeathChaos25 is offline
DeathChaos25
Senior Member
Join Date: Jan 2014
Location: Puerto Rico
Old 03-29-2015 , 19:26   Re: [L4D2] Restore Survivor Death Animations (UPDATED 03-29-2015)
Reply With Quote #48

Updated the plugin!

- Fixed an issue where survivors who where in death animations could still try to use medkits or revive survivors who where incapacitated
__________________
DeathChaos25 is offline
Krufftys Killers
Senior Member
Join Date: Jan 2014
Old 06-20-2015 , 14:36   Re: [L4D2] Restore Survivor Death Animations (UPDATED 03-29-2015)
Reply With Quote #49

Got this error today
L 06/19/2015 - 11:29:12: SourceMod error session started
L 06/19/2015 - 11:29:12: Info (map "l4d2_pdmesa02_shafted") (file "errors_20150619.log")
L 06/19/2015 - 11:29:12: [SM] Native "IsClientInGame" reported: Client index 0 is invalid
L 06/19/2015 - 11:29:12: [SM] Displaying call stack trace for plugin "[L4D2] Death Animations Restore.smx":
L 06/19/2015 - 11:29:12: [SM] [0] Line 139, C:\Program Files (x86)\Steam\steamapps\common\Left 4 Dead 2\left4dead2\addons\sourcemod\scripting\[L4D2] Death Animations Restore.sp::ForcePlayerSuicideTimer()
L 06/19/2015 - 110:06: Error log file session closed.
Krufftys Killers is offline
Edison1318
Senior Member
Join Date: Nov 2015
Location: Peaceful place of the in
Old 12-10-2015 , 08:21   Re: [L4D2] Restore Survivor Death Animations (UPDATED 03-29-2015)
Reply With Quote #50

Well it really works for all of the survivors but it doesn't work for FakeZoey. Because somehow fakezoey died and then perform death animation endlessly. The game started with 8 survivors and then Zoey was replaced as Rochelle but Zoey is still in Rochelle voice. I use !csc and select Zoey into Zoey so Zoey will speak in her own voices but she still replaced as Nick. If Nick was dead, then only Zoey can die. I am really confused about these plugins but it seems like it doesn't work out and sorry about horrible grammar, i hope you could understand what am i saying.

Extra bugs:
When i try to use Defib Zoey, Nick or Rochelle revived but Zoey's body is gone.

Last edited by Edison1318; 12-11-2015 at 01:33.
Edison1318 is offline
Send a message via Skype™ to Edison1318
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 03:18.


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