AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugin/Gameplay Ideas and Requests (https://forums.alliedmods.net/forumdisplay.php?f=60)
-   -   [L4D2] Block finale rescue infinite tanks (https://forums.alliedmods.net/showthread.php?t=328088)

JLmelenchon 10-26-2020 05:01

[L4D2] Block finale rescue infinite tanks
 
Originally this plugin* blocks one of the two tank spawning in the finale event. This is not what i want to do, but i think it could be a good base for my idea except i don't know what to change.

What i want to do is blocking the extra tanks who spawn to infinity when the rescue vehicle is comming for survivors (the third tank ect) for balance purpose. I guess the "tankicount" will have to be changed to something else, also "m_bInSecondHalfOfRound" should be replaced by something like "m_bInSendInRescueVehicle" maybe ? By the way i guess it is going to create conflicts as all finales don't work the same way (dead center, the sacrifice, ect)

* the plugin in question: https://github.com/SirPlease/L4D2-Co...ank_blocker.sp

HarryPotter 10-26-2020 06:35

Re: [L4D2] Block finale rescue infinite tanks
 
Quote:

Originally Posted by JLmelenchon (Post 2722579)
What i want to do is blocking the extra tanks who spawn to infinity when the rescue vehicle is comming for survivors (the third tank ect) for balance purpose.

Check here
https://github.com/fbef0102/L4D1-Com...oEscapeTank.sp

you probably need to modify since this needs old left4downtown extension

Psyk0tik 10-26-2020 06:49

Re: [L4D2] Block finale rescue infinite tanks
 
1 Attachment(s)
There is no such thing as a "m_bInSendInRescueVehicle" prop according to the datamap and netprop dumps. What you could maybe do is check for finale type 6 (Rescue vehicle is ready) and block it.

According to Left 4 DHooks' documentation for L4D2_OnChangeFinaleStage, that finale type only signals endless Hordes/Tanks, which sounds like the infinite Tanks you're referring to. Of course, this would mean that hordes will stop spawning as well so only the six special infected will spawn.

You also have the other option of blocking Tank spawns when the finale type is 6.

Here's a plugin that allows you to pick between the two options I explained. I've tested both options on Dark Carnival's finale.

Requires Left 4 DHooks: https://forums.alliedmods.net/showthread.php?t=321696
PHP Code:

#include <sourcemod>
#include <left4dhooks>

#pragma semicolon 1
#pragma newdecls required

public Plugin myinfo =
{
    
name "[L4D2] Infinite Hordes/Tanks Blocker",
    
author "Psyk0tik (Crasher_3637)",
    
description "Blocks infinite hordes/Tanks when rescue vehicle is ready.",
    
version "1.0",
    
url "https://forums.alliedmods.net/showthread.php?t=328088"
};

public 
APLRes AskPluginLoad2(Handle myselfbool latechar[] errorint err_max)
{
    if (
GetEngineVersion() != Engine_Left4Dead2)
    {
        
strcopy(errorerr_max"\"Infinite Hordes/Tanks Blocker\" only supports Left 4 Dead 2.");

        return 
APLRes_SilentFailure;
    }

    return 
APLRes_Success;
}

ConVar g_cvBlockMethod;

int g_iFinaleType;

public 
void OnPluginStart()
{
    
g_cvBlockMethod CreateConVar("l4d2_ifb_method""1""Method for blocking infinite Tanks when rescue vehicle arrives.\n0: Block infinite hordes/Tanks.\n1: Block Tanks from spawning."_true0.0true1.0);

    
AutoExecConfig(true"l4d2_infinite_finale_blocker");
}

public 
void OnMapStart()
{
    
g_iFinaleType 0;
}

public 
void OnMapEnd()
{
    
g_iFinaleType 0;
}

public 
Action L4D_OnSpawnTank(const float vecPos[3], const float vecAng[3])
{
    
// Rescue Vehicle Ready; block infinite Tank spawns
    
return (g_cvBlockMethod.BoolValue && g_iFinaleType == 6) ? Plugin_Handled Plugin_Continue;
}

public 
Action L4D2_OnChangeFinaleStage(int &finaleType, const char[] arg)
{
    if (!
g_cvBlockMethod.BoolValue && finaleType == 6)
    {
        return 
Plugin_Handled// Rescue Vehicle Ready; block change to prevent infinite hordes/Tanks
    
}

    
g_iFinaleType finaleType// Record finale type

    
return Plugin_Continue// Continue as usual



JLmelenchon 10-28-2020 07:22

Re: [L4D2] Block finale rescue infinite tanks
 
This works for regular finales, perfect.

sergrt14 11-01-2020 20:56

Re: [L4D2] Block finale rescue infinite tanks
 
Quote:

Originally Posted by Crasher_3637 (Post 2722591)
There is no such thing as a "m_bInSendInRescueVehicle" prop according to the datamap and netprop dumps. What you could maybe do is check for finale type 6 (Rescue vehicle is ready) and block it.

According to Left 4 DHooks' documentation for L4D2_OnChangeFinaleStage, that finale type only signals endless Hordes/Tanks, which sounds like the infinite Tanks you're referring to. Of course, this would mean that hordes will stop spawning as well so only the six special infected will spawn.

You also have the other option of blocking Tank spawns when the finale type is 6.

Here's a plugin that allows you to pick between the two options I explained. I've tested both options on Dark Carnival's finale.

Requires Left 4 DHooks: https://forums.alliedmods.net/showthread.php?t=321696
PHP Code:

#include <sourcemod>
#include <left4dhooks>

#pragma semicolon 1
#pragma newdecls required

public Plugin myinfo =
{
    
name "[L4D2] Infinite Hordes/Tanks Blocker",
    
author "Psyk0tik (Crasher_3637)",
    
description "Blocks infinite hordes/Tanks when rescue vehicle is ready.",
    
version "1.0",
    
url "https://forums.alliedmods.net/showthread.php?t=328088"
};

public 
APLRes AskPluginLoad2(Handle myselfbool latechar[] errorint err_max)
{
    if (
GetEngineVersion() != Engine_Left4Dead2)
    {
        
strcopy(errorerr_max"\"Infinite Hordes/Tanks Blocker\" only supports Left 4 Dead 2.");

        return 
APLRes_SilentFailure;
    }

    return 
APLRes_Success;
}

ConVar g_cvBlockMethod;

int g_iFinaleType;

public 
void OnPluginStart()
{
    
g_cvBlockMethod CreateConVar("l4d2_ifb_method""1""Method for blocking infinite Tanks when rescue vehicle arrives.\n0: Block infinite hordes/Tanks.\n1: Block Tanks from spawning."_true0.0true1.0);

    
AutoExecConfig(true"l4d2_infinite_finale_blocker");
}

public 
void OnMapStart()
{
    
g_iFinaleType 0;
}

public 
void OnMapEnd()
{
    
g_iFinaleType 0;
}

public 
Action L4D_OnSpawnTank(const float vecPos[3], const float vecAng[3])
{
    
// Rescue Vehicle Ready; block infinite Tank spawns
    
return (g_cvBlockMethod.BoolValue && g_iFinaleType == 6) ? Plugin_Handled Plugin_Continue;
}

public 
Action L4D2_OnChangeFinaleStage(int &finaleType, const char[] arg)
{
    if (!
g_cvBlockMethod.BoolValue && finaleType == 6)
    {
        return 
Plugin_Handled// Rescue Vehicle Ready; block change to prevent infinite hordes/Tanks
    
}

    
g_iFinaleType finaleType// Record finale type

    
return Plugin_Continue// Continue as usual



This is blocking in finale escape tank spawning ? or Spawning infinite tank in escape ?

Psyk0tik 11-01-2020 21:16

Re: [L4D2] Block finale rescue infinite tanks
 
Quote:

Originally Posted by sergrt14 (Post 2723382)
This is blocking in finale escape tank spawning ? or Spawning infinite tank in escape ?

It blocks Tanks from spawning once the rescue vehicle arrives.

GsiX 11-02-2020 22:22

Re: [L4D2] Block finale rescue infinite tanks
 
i have no knowledge in this but why not just count and kick the extra tank? they are playable char. or just slay it.. aka ask them to suicide.

Marttt 11-02-2020 23:10

Re: [L4D2] Block finale rescue infinite tanks
 
In some servers killing a tank gives "points", so it could be used as an exploit (depends on)

Crasher method prevents the spawn by checking the finale type, which is the best solution besides the l4dhooks dependency

Psyk0tik 11-02-2020 23:10

Re: [L4D2] Block finale rescue infinite tanks
 
Quote:

Originally Posted by GsiX (Post 2723527)
i have no knowledge in this but why not just count and kick the extra tank? they are playable char. or just slay it.. aka ask them to suicide.

That's an old and inefficient method. It's faster to just prevent the spawning in the first place than to keep tracking new spawns and kicking/slaying them.


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

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