Raised This Month: $ Target: $400
 0% 

[L4D, L4D2] No Death Check Until Dead


Post New Thread Reply   
 
Thread Tools Display Modes
Skorpion1976
Veteran Member
Join Date: Jun 2009
Location: Austria
Old 11-08-2010 , 13:23   Re: [L4D] & [L4D2] No Death Check Until Dead
Reply With Quote #11

Quote:
Originally Posted by DieTeetasse View Post
The events are also invoked for common infected, which have no clientid, because they are entities and therefore no team.
Does this mean that the check for team 2 or team 3 is not enough o_O ?
Skorpion1976 is offline
DieTeetasse
Senior Member
Join Date: Jul 2009
Old 11-08-2010 , 17:17   Re: [L4D] & [L4D2] No Death Check Until Dead
Reply With Quote #12

@Skorpion1976:
No, it's not enough. Always check against client == 0 or check with IsClientInGame(client) ;)

@chinagreenelvis:
You are right, commons do not have anything to do with players, but in fact the event player_death is also fired for common infected (god knows why...). (Not sure for player_hurt.)
__________________

Last edited by DieTeetasse; 11-08-2010 at 17:21.
DieTeetasse is offline
AtomicStryker
Veteran Member
Join Date: Apr 2009
Location: Teutonia!!
Old 11-08-2010 , 17:30   Re: [L4D] & [L4D2] No Death Check Until Dead
Reply With Quote #13

Because player_death is a generic source event that applies for all CBaseCombatCharacters (including commons)
AtomicStryker is offline
chinagreenelvis
Senior Member
Join Date: Dec 2009
Old 11-08-2010 , 17:34   Re: [L4D] & [L4D2] No Death Check Until Dead
Reply With Quote #14

Ah, okay, thanks guys. I'll see if I can't whip this into shape.
chinagreenelvis is offline
chinagreenelvis
Senior Member
Join Date: Dec 2009
Old 11-09-2010 , 04:38   Re: [L4D] & [L4D2] No Death Check Until Dead
Reply With Quote #15

Eleven hours later and I came up with a fix. It's going to require a lot more coding, however, to make sure all the events are being considered.

It seems to be dependent entirely upon setting the convar, resetting it, and then setting it again only at specific points like incapacitation. The player_death event is the most finicky, since using it to reset the convar requires that the action not be preceded by any calculations.

All in all, what should be very simple is extremely ridiculous and complicated.

Does anyone know if it's possible to force the "mission_lost" event? Or to in any way force the survivors to lose the round? If so, that would make this much simpler.
chinagreenelvis is offline
Skorpion1976
Veteran Member
Join Date: Jun 2009
Location: Austria
Old 11-09-2010 , 13:53   Re: [L4D] & [L4D2] No Death Check Until Dead
Reply With Quote #16

You can post here http://forums.alliedmods.net/forumdisplay.php?f=60
Skorpion1976 is offline
chinagreenelvis
Senior Member
Join Date: Dec 2009
Old 11-13-2010 , 22:38   Re: [L4D] & [L4D2] No Death Check Until Dead
Reply With Quote #17

Update posted.

The new version should solve the problem of the mission being lost if all remaining players are incapped when one person dies. However, it doesn't seem to work properly until the mission is restarted. The first time all players are dead, the death-check doesn't manage to end the mission. I have no idea why and if anyone can figure out how to fix it, I'd greatly appreciate it.
chinagreenelvis is offline
chinagreenelvis
Senior Member
Join Date: Dec 2009
Old 11-13-2010 , 23:06   Re: [L4D] & [L4D2] No Death Check Until Dead
Reply With Quote #18

Nevermind, it's been fixed. As far as I can tell, it works perfectly now.
chinagreenelvis is offline
chinagreenelvis
Senior Member
Join Date: Dec 2009
Old 11-14-2010 , 21:01   Re: [L4D, L4D2] No Death Check Until Dead
Reply With Quote #19

Minor error corrected. It still wasn't working properly but I believe it should be now.
chinagreenelvis is offline
Skorpion1976
Veteran Member
Join Date: Jun 2009
Location: Austria
Old 11-15-2010 , 12:27   Re: [L4D, L4D2] No Death Check Until Dead
Reply With Quote #20

Quote:
Originally Posted by chinagreenelvis View Post
Minor error corrected. It still wasn't working properly but I believe it should be now.
1. What is this supposed to do on a 10vs10 server ?
2. Why is MissionWillBeLost true if DeadGuys = 3?
3. Why do you consider a bot as "DeadGuy" ?

PHP Code:
DeadCheck()
{
    new 
DeadGuys 0
    for(new 
1<= MaxClientsi++) 
    { 
        if (
IsClientConnected(i) && IsClientInGame(i) && GetClientTeam(i) == 2
        { 
            if (!
IsPlayerAlive(i) || IsFakeClient(i)) 
            {     
                
DeadGuys++; 
            } 
        } 
    } 
     
    if (
DeadGuys == 3)
    { 
        
MissionWillBeLost true;
    }
    else 
    { 
        
MissionWillBeLost false;
    } 

Skorpion1976 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 03:12.


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