AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   [L4D, L4D2] No Death Check Until Dead (https://forums.alliedmods.net/showthread.php?t=142432)

chinagreenelvis 11-05-2010 19:14

[L4D, L4D2] No Death Check Until Dead
 
21 Attachment(s)
The file has been updated to the version written by user DCX2.

This will prevent the mission from being lost simply because all remaining players have been incapacitated. Mission loss will not occur until there are no living survivors. This can be used on servers with any number of survivor players. There is also a switch to allow or disallow bots to continue without human survivors.

Cvars
deathcheck 1, 0: Disable plugin, 1: Enable plugin
deathcheck_bots 1, 0: Mission will be lost if all human players have died, 1: Bots will continue playing after all human players are dead and can rescue them

Recommended additional plugins
  • AutoHelp: Survivors help themselves from special infected attacks and incapacitation
  • Improved Bots: This mod makes several changes to bots to make them act more like human players and make them more reliable as teammates. They can use melee weapons, rescue you if you die, react quicker to a teammate being attacked by a special infected and much more.
  • Survivor Bot Takeover: Allows dead players to take the place of a living survivor bot.

ChickenFighter 11-06-2010 02:49

Re: [L4D] & [L4D2] No Death Check Until Dead
 
What does this pugin do? O.o cant understand it

teo265 11-06-2010 02:51

Re: [L4D] & [L4D2] No Death Check Until Dead
 
Very good idea, i hate it when the game ends when we all are incapped, because usually i "self help" myself immediatly after im incapped, thanks!

ChickenFighter 11-06-2010 02:53

Re: [L4D] & [L4D2] No Death Check Until Dead
 
Ah okey.... good thanks toe

Herokim 11-06-2010 17:27

Re: [L4D] & [L4D2] No Death Check Until Dead
 
Either this plugin is wrong, or it interferes with something.

Map restart = crash of the server :/ And some errors -

Code:

L 11/06/2010 - 22:09:35: [SM] Native "GetClientTeam" reported: Client index 0 is invalid
L 11/06/2010 - 22:09:35: [SM] Displaying call stack trace for plugin "l4d_2_deathcheck.smx":
L 11/06/2010 - 22:09:35: [SM]  [0]  Line 52, /home/groups/alliedmodders/forums/files/6/6/3/4/6/76788.attach::Event_PlayerDeath()
L 11/06/2010 - 22:09:35: [SM] Native "GetClientTeam" reported: Client index 0 is invalid
L 11/06/2010 - 22:09:35: [SM] Displaying call stack trace for plugin "l4d_2_deathcheck.smx":
L 11/06/2010 - 22:09:35: [SM]  [0]  Line 52, /home/groups/alliedmodders/forums/files/6/6/3/4/6/76788.attach::Event_PlayerDeath()
L 11/06/2010 - 22:09:35: [SM] Native "GetClientTeam" reported: Client index 0 is invalid
L 11/06/2010 - 22:09:35: [SM] Displaying call stack trace for plugin "l4d_2_deathcheck.smx":
L 11/06/2010 - 22:09:35: [SM]  [0]  Line 52, /home/groups/alliedmodders/forums/files/6/6/3/4/6/76788.attach::Event_PlayerDeath()
L 11/06/2010 - 22:09:35: [SM] Native "GetClientTeam" reported: Client index 0 is invalid
L 11/06/2010 - 22:09:35: [SM] Displaying call stack trace for plugin "l4d_2_deathcheck.smx":
L 11/06/2010 - 22:09:35: [SM]  [0]  Line 52, /home/groups/alliedmodders/forums/files/6/6/3/4/6/76788.attach::Event_PlayerDeath()
L 11/06/2010 - 22:09:35: [SM] Native "GetClientTeam" reported: Client index 0 is invalid
L 11/06/2010 - 22:09:35: [SM] Displaying call stack trace for plugin "l4d_2_deathcheck.smx":
L 11/06/2010 - 22:09:35: [SM]  [0]  Line 52, /home/groups/alliedmodders/forums/files/6/6/3/4/6/76788.attach::Event_PlayerDeath()
L 11/06/2010 - 22:09:35: [SM] Native "GetClientTeam" reported: Client index 0 is invalid
L 11/06/2010 - 22:09:35: [SM] Displaying call stack trace for plugin "l4d_2_deathcheck.smx":
L 11/06/2010 - 22:09:35: [SM]  [0]  Line 52, /home/groups/alliedmodders/forums/files/6/6/3/4/6/76788.attach::Event_PlayerDeath()

I'm playing on my own dedicated server and what is that ? Why it thinks I am the server?

Skorpion1976 11-07-2010 10:50

Re: [L4D] & [L4D2] No Death Check Until Dead
 
This is a great idea. We use the self revive plugin from panxiohai and everytime we get up AFTER f....g round_end event :). Please include a check for client 0. I donīt have the code for that but some plugins had the same problems until they checked for index 0.

DieTeetasse 11-07-2010 11:54

Re: [L4D] & [L4D2] No Death Check Until Dead
 
The events are also invoked for common infected, which have no clientid, because they are entities and therefore no team.

TastyCheese 11-07-2010 15:25

Re: [L4D] & [L4D2] No Death Check Until Dead
 
I tried this, and the chapter gets restarted when one person from the team dies, even if the three others are still incapped. I'm hoping this will get fixed because this plugin is exactly what I'm looking for :)

chinagreenelvis 11-08-2010 13:11

Re: [L4D] & [L4D2] No Death Check Until Dead
 
Tasty, I think I know why that might be happening. I'll make the proper adjustments to the code tonight.

Die, I don't know what you're talking about with the CI. Could you explain? I wouldn't think that player_hurt or player_death have anything to do with the commons.

Scorpion, I'd like to find out more about what you're saying. If you could find an example of it, please let me know.

Herokim, I don't know where those errors are coming from. I don't get them at all.

Skorpion1976 11-08-2010 13:21

Re: [L4D] & [L4D2] No Death Check Until Dead
 
found here:https://forums.alliedmods.net/showthread.php?t=63759
PHP Code:

//Make sure it's not console
    
if(client == 0){
        return 
Plugin_Continue
    


That SHOULD fix the errors he posted above.

Skorpion1976 11-08-2010 13:23

Re: [L4D] & [L4D2] No Death Check Until Dead
 
Quote:

Originally Posted by DieTeetasse (Post 1344203)
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 ?

DieTeetasse 11-08-2010 17:17

Re: [L4D] & [L4D2] No Death Check Until Dead
 
@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.)

AtomicStryker 11-08-2010 17:30

Re: [L4D] & [L4D2] No Death Check Until Dead
 
Because player_death is a generic source event that applies for all CBaseCombatCharacters (including commons)

chinagreenelvis 11-08-2010 17:34

Re: [L4D] & [L4D2] No Death Check Until Dead
 
Ah, okay, thanks guys. I'll see if I can't whip this into shape.

chinagreenelvis 11-09-2010 04:38

Re: [L4D] & [L4D2] No Death Check Until Dead
 
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.

Skorpion1976 11-09-2010 13:53

Re: [L4D] & [L4D2] No Death Check Until Dead
 
You can post here http://forums.alliedmods.net/forumdisplay.php?f=60

chinagreenelvis 11-13-2010 22:38

Re: [L4D] & [L4D2] No Death Check Until Dead
 
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 11-13-2010 23:06

Re: [L4D] & [L4D2] No Death Check Until Dead
 
Nevermind, it's been fixed. As far as I can tell, it works perfectly now.

chinagreenelvis 11-14-2010 21:01

Re: [L4D, L4D2] No Death Check Until Dead
 
Minor error corrected. It still wasn't working properly but I believe it should be now.

Skorpion1976 11-15-2010 12:27

Re: [L4D, L4D2] No Death Check Until Dead
 
Quote:

Originally Posted by chinagreenelvis (Post 1349690)
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;
    } 



chinagreenelvis 11-15-2010 13:31

Re: [L4D, L4D2] No Death Check Until Dead
 
Quote:

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" ?
1. Currently, this only works on a server where the maximum amount of survivors is four players. There are so many other plugins and other ways of allowing more than four survivors that I haven't yet implemented this feature in the death check.

2. MissionWillBeLost determines whether or not director_no_death_check will be set to 0 the next time a human player dies. If the only player still alive is a human, MissionWillBeLost gets set to true. If another living human player is put into the game, MissionWillBeLost gets set to false. If it's false, the next time a human player dies, the cvar does not get reset to 0. Right now I'm using the number 3 for this check because it's only intended for servers with 4 survivor players. Three dead humans, bots, or idle players will make the death check kick in when the fourth one gets killed.

3. Bots and idle players are considered "deadguys" because, by default, they don't go on playing when there are no more human players alive. If you were playing on a map with no other human players and you die, the mission is restarted. This is how the game works without plugins. I can't imagine anyone would want the game to allow bots to continue playing when all human players are dead, but if you really want that feature, I believe there is a cvar which allows them to keep playing despite all human players being dead, and this plugin could be altered to check for that.

chinagreenelvis 11-15-2010 18:34

Re: [L4D, L4D2] No Death Check Until Dead
 
Update: Fixed a bug where the death check stopped working after the first map of a campaign.

Skorpion1976 11-16-2010 06:08

Re: [L4D, L4D2] No Death Check Until Dead
 
There are some plugins, especially "takeover 0.8" which allows you to takeover a living bot after you died. I think your plugin is still capable of getting used in multislot servers.
1.
You wrote that you set the value to 3 because of max survivors = 4.
So I could set this value to 9, as we have 10 survivors, right ? If this works you could create a cvar which handles the survivor count, so the plugin can be used for ANY survivor count instead of 4 only.
2.
Remove the check for bots. Without this check for bots the round continues and we can type !takeover to continue as the bot. My aim is that this plugin ONLY ends a round when EVERYBODY is DEAD :)
Would this work or do you see any complications?

TastyCheese 11-16-2010 06:16

Re: [L4D, L4D2] No Death Check Until Dead
 
Quote:

Originally Posted by chinagreenelvis (Post 1350073)
Right now I'm using the number 3 for this check because it's only intended for servers with 4 survivor players. Three dead humans, bots, or idle players will make the death check kick in when the fourth one gets killed..

This got me wondering... Let's say me and a friend want to play a 2-player game, so one of us hosts and kicks the two bots, leaving only us two. Will the chapter restart if we both get killed or will it be stuck waiting for a third player (that doesn't exist) to die?

chinagreenelvis 11-16-2010 09:53

Re: [L4D, L4D2] No Death Check Until Dead
 
I could create a cvar which toggles the bot-check for people who want to use that takeover option, or for people who just want to let the bots keep on going for whatever reason.

As for the number of players, I'm sure there's probably an easy to way to set this dynamically. I would think that if you had less than four it would probably not work in it's current incarnation. I'll look into this. Creating a cvar for extra players is an option but making it dynamic based on the total number of survivors in play (bot and human alike, both dead and alive) would kill two birds with one stone.

chinagreenelvis 11-16-2010 16:36

Re: [L4D, L4D2] No Death Check Until Dead
 
Update: Toggle for including or excluding bots and idle players added. The plugin also now works with any number of players.

The number of players fix was easier than I thought it would be. Now, instead of checking for the number of dead players, it checks for the number of alive ones. When that number drops to one, the boolean for the death check gets set to true. When the number goes above or below that, it's reset to false.

chinagreenelvis 11-18-2010 20:06

Re: [L4D, L4D2] No Death Check Until Dead
 
1 Attachment(s)
Update 1.4.1 - Possible bugfix, we'll see it it works. It's uploaded either way.

MasterMind420 11-18-2010 22:33

Re: [L4D, L4D2] No Death Check Until Dead
 
Yeah, found a bug in the previous version, probly the same one u discovered. If connected with only one player in game, all players dead, the map restart works. If more than one player is in game the mod will not restart the map after all players are dead, tested both option 1 and 2. Will be testing the new version tomorrow and will get back to you. Btw thanks for the great plugin, I'm pretty sure the one before the last worked fine even with 4+ players, tested on helms deep map(not 100% sure though. Anyways, I will keep u posted on my findings.

chinagreenelvis 11-18-2010 23:29

Re: [L4D, L4D2] No Death Check Until Dead
 
Odd. So this problem is from the latest versions only? I should start saving previous versions of these...

chinagreenelvis 11-18-2010 23:41

Re: [L4D, L4D2] No Death Check Until Dead
 
I know exactly why it's not working. It's because I added that one extra "if" section to the player_death event and it doesn't like it. It's finicky about the number of calculations it has to go through before it works.

I may have to create two different versions of this: one that includes bots and one that excludes them. Otherwise I'll have to come up with a pretty creative workaround...

iagorockboy 11-19-2010 06:23

Re: [L4D, L4D2] No Death Check Until Dead
 
its weird, it seems to work fine but whenever i die and the are still bots out there the game keeps going, also when everyone dies including bots the game still keeps going, the game never ends anymore, how do i fix this?

chinagreenelvis 11-19-2010 09:25

Re: [L4D, L4D2] No Death Check Until Dead
 
Quote:

Originally Posted by iagorockboy (Post 1352266)
its weird, it seems to work fine but whenever i die and the are still bots out there the game keeps going, also when everyone dies including bots the game still keeps going, the game never ends anymore, how do i fix this?

Yeah, there's a bug in the latest version, I need to rework part of the code to get it going again. Check back, should be fixed by the end of the day.

MasterMind420 11-19-2010 16:47

Re: [L4D, L4D2] No Death Check Until Dead
 
yeah i have no experience coding mods(currently), but will eventually learn. Would be glad to test anything u come up with. One thing i've learned because i use so many mods on my server is that backups will save the day. Although I can't say that for this mod because I didn't backup the original, if I had I would have uploaded it to you, won't make that mistake again though haha, I love this mod. Lets you fight it out till the bitter end....

TastyCheese 11-19-2010 17:01

Re: [L4D, L4D2] No Death Check Until Dead
 
I have the very first version of this plugin backed up, along with 1.4. If you want them, just leave a message :wink:

chinagreenelvis 11-19-2010 17:35

Re: [L4D, L4D2] No Death Check Until Dead
 
1 Attachment(s)
Update 1.4.2: I believe I've circumvented the death_check fail without removing any of the options. It's working for me so far.

MasterMind420 11-20-2010 09:36

Re: [L4D, L4D2] No Death Check Until Dead
 
Cool, seems to be working now with more than human player. I will test it on helms deep with 4+ players later today and post my findings.....so far so good...

MasterMind420 11-20-2010 14:56

Re: [L4D, L4D2] No Death Check Until Dead
 
Still not restarting with more than 1 players in game and everyone dead.....

MasterMind420 11-20-2010 15:44

Re: [L4D, L4D2] No Death Check Until Dead
 
yeah there's definately a problem with restarting the map after everyones dead same as previous release...

MasterMind420 11-20-2010 15:45

Re: [L4D, L4D2] No Death Check Until Dead
 
strange becuse it worked the first time i played...

MasterMind420 11-20-2010 16:51

Re: [L4D, L4D2] No Death Check Until Dead
 
ok so this is working, i just got done playing a game and it works with 3 people online, i tried it earlier with just 2 people and it didn't restart the map...so something is still wrong with it...


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

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