Raised This Month: $32 Target: $400
 8% 

[L4D(2)] SuperVersus [1.5.4]


Post New Thread Reply   
 
Thread Tools Display Modes
Black Rain
Junior Member
Join Date: Mar 2017
Old 05-29-2020 , 22:15   Re: [L4D(2)] SuperVersus [1.5.4]
Reply With Quote #1281

How can I disable this HUD?



It constantly pops up even when I hit exit. Using foxhound27's version on my server.
Black Rain is offline
Natan
Member
Join Date: Aug 2015
Location: Behind you
Old 05-29-2020 , 23:58   Re: [L4D(2)] SuperVersus [1.5.4]
Reply With Quote #1282

sm_cvar l4d_management "2"
Natan is offline
Shao
Senior Member
Join Date: Jan 2015
Old 05-30-2020 , 13:36   Re: [L4D(2)] SuperVersus [1.5.4]
Reply With Quote #1283

I know this might be more or less of an issue, but extra bots always respawn at the end of a round towards the new map, making them lose their equipment. I've noticed however that if a player controlled that bot in the past, the server remembers it and in turn doesn't respawn anymore, even if that player has left the server later on.

Is it possible to fix such thing?

Edit: Found a fix.

https://forums.alliedmods.net/showth...02#post2403402

Last edited by Shao; 06-05-2020 at 01:19. Reason: Solution found.
Shao is offline
Shao
Senior Member
Join Date: Jan 2015
Old 06-03-2020 , 04:44   Re: [L4D(2)] SuperVersus [1.5.4]
Reply With Quote #1284

@foxhound27 Could be missing something but the cvars to increase tank health or horde doesn't work. I did try the tankhpfix as well, unfortunately with no good result.

Last edited by Shao; 06-03-2020 at 04:45.
Shao is offline
Shao
Senior Member
Join Date: Jan 2015
Old 06-05-2020 , 01:15   Re: [L4D(2)] SuperVersus [1.5.4]
Reply With Quote #1285

Alright! Here's what I think may be the final update of this plugin, given that I had the time to quickly test it and nothing seemed out of the ordinary, my buddies gave me the green light as well so!

There is a lot of customization added and fixes for all it's previous issues with CI, SI and the Tank, even in Versus! Should the plugin now update each time a new client connect or disconnect and will print it's intended stats in everyone's console.

It was also updated to work with Left4DHooks for the extra Co-Op SI which can be found here: https://forums.alliedmods.net/showthread.php?t=321696

Credits to my good friends coding skills for it found in the plugin description.

Edit: Re-Download the plugin if you haven't already, there was a mistake that kept doubling the tank HP, cvars were also added so that the horde can still be manipulated instead of hard coded.

Edit 2: Revised and showed consistent results.

Edit 3: Optimized with recommendations and fixed some more mistakes.

Edit 4: ... One last mistake, hopefully. SI Health would go up on a player join but not go back to lower values when a player left.

Edit 5: Added difficulty check for survivor bots when they are kicked.

Edit 6: Added First Aid Kits on finales that aren't gauntlets to keep things fair with extra survivors, fixed the auto-join to take control of live survivor in Co-Op regardless of the survivor set/characters when player count is still 4, it used to ignore those and would connect players dead or as a 5th survivor instead, forcing humans to kick a bot.
Attached Files
File Type: txt l4d_superversus.txt (2.7 KB, 1324 views)
File Type: sp Get Plugin or Get Source (l4d_superversus.sp - 2394 views - 78.4 KB)

Last edited by Shao; 08-12-2020 at 07:08. Reason: Optimization and fixes.
Shao is offline
Silvers
SourceMod Plugin Approver
Join Date: Aug 2010
Location: SpaceX
Old 06-05-2020 , 15:10   Re: [L4D(2)] SuperVersus [1.5.4]
Reply With Quote #1286

PHP Code:
    // If lobby is full, KillRes is true and l4dt is present, unreserve lobby
    
if(KillRes.BoolValue && IsServerLobbyFull() && l4dt()) 
Code:
 && l4dt()
This is no longer required since left4dhooks added support for L4D_LobbyUnreserve() now. I'll leave it up to others to adjust, too many different versions here.
__________________
Silvers is offline
Shao
Senior Member
Join Date: Jan 2015
Old 06-06-2020 , 08:35   Re: [L4D(2)] SuperVersus [1.5.4]
Reply With Quote #1287

Quote:
Originally Posted by Silvers View Post
PHP Code:
    // If lobby is full, KillRes is true and l4dt is present, unreserve lobby
    
if(KillRes.BoolValue && IsServerLobbyFull() && l4dt()) 
Code:
 && l4dt()
This is no longer required since left4dhooks added support for L4D_LobbyUnreserve() now. I'll leave it up to others to adjust, too many different versions here.
Fixed accordingly! Have a look if you ever get time.

Posting so people know that this was updated again, probably the last, hopefully!
Shao is offline
Silvers
SourceMod Plugin Approver
Join Date: Aug 2010
Location: SpaceX
Old 06-06-2020 , 08:37   Re: [L4D(2)] SuperVersus [1.5.4]
Reply With Quote #1288

Looks good, supports both left4downtown and left4dhooks, doesn't matter which version it's run on. Good job.
__________________
Silvers is offline
Spirit_12
Veteran Member
Join Date: Dec 2012
Location: Toronto, CA
Old 06-06-2020 , 17:15   Re: [L4D(2)] SuperVersus [1.5.4]
Reply With Quote #1289

Skimmed through the source and it seems like SuperVersus has just turned into a combination of a lot of different plugins. I did not look through the whole source, but these are the things that I noticed.

These are not game breaking bugs by any means, however optimization and good coding practices.

- Missing the new-style declaration.

PHP Code:
 #pragma newdecls required; 
- Events are using old style syntax.
PHP Code:
public void Event_(Handle event, const char[] namebool dontBroadcast)
{
    
int client GetClientOfUserId(GetEventInt(event"userid"));



PHP Code:
public void Event_(Event event, const char[] namebool dontBroadcast)
{
    
int  client GetClientOfUserId(event.GetInt("userid"));

- Older syntax again.
PHP Code:
    decl String:z_difficulty[16]; 

PHP Code:
    char z_difficulty[16]; 
- Repetition of FindConvar. Cache them and then reuse them if you need them. This way you can hook and add convar change to see track when they get updated.

In fact, the FindConvar native is being called 79 times. That should not happen in SuperVersus or 99% of the other plugins at all.

PHP Code:
public void CommonInfectedUpdater()
{
    
int extrasurvivors GetSurvivorTeam() - 4;
    
extrasurvivors = (extrasurvivors 0) ? extrasurvivors 0;
    
float spawn_multi CiSpMulti.FloatValue extrasurvivors ;
    
FindConVar("z_mob_spawn_finale_size").IntValue    RoundFloat(CIMobSpawnFinaleSize.FloatValue*spawn_multi);
    
FindConVar("z_mob_spawn_max_size").IntValue     RoundFloat(CIMobSpawnMaxSize.FloatValue*spawn_multi);
    
FindConVar("z_mob_spawn_min_size").IntValue        RoundFloat(CIMobSpawnMinSize.FloatValue*spawn_multi);
    
FindConVar("z_mega_mob_size").IntValue            RoundFloat(CIMegaMobSize.FloatValue*spawn_multi);
    
FindConVar("z_common_limit").IntValue            RoundFloat(CICommonMobLimit.FloatValue*spawn_multi);
    
FindConVar("z_background_limit").IntValue        RoundFloat(CIBackgroundMobSize.FloatValue*spawn_multi);

    if(
ITHordeTimers.BoolValue)
        {
        
FindConVar("z_mob_spawn_max_interval_easy").IntValue    RoundToFloor(ITMobSpawnMaxIntervalEasy.FloatValue spawn_multi);
        
FindConVar("z_mob_spawn_max_interval_normal").IntValue    RoundToFloor(ITMobSpawnMaxIntervalNormal.FloatValue spawn_multi);
        
FindConVar("z_mob_spawn_max_interval_hard").IntValue    RoundToFloor(ITMobSpawnMaxIntervalHard.FloatValue spawn_multi);
        
FindConVar("z_mob_spawn_max_interval_expert").IntValue    RoundToFloor(ITMobSpawnMaxIntervalExpert.FloatValue spawn_multi);
        
FindConVar("z_mob_spawn_min_interval_easy").IntValue    RoundToFloor(ITMobSpawnMinIntervalEasy.FloatValue spawn_multi);
        
FindConVar("z_mob_spawn_min_interval_normal").IntValue    RoundToFloor(ITMobSpawnMinIntervalNormal.FloatValue spawn_multi);
        
FindConVar("z_mob_spawn_min_interval_hard").IntValue    RoundToFloor(ITMobSpawnMinIntervalHard.FloatValue spawn_multi);
        
FindConVar("z_mob_spawn_min_interval_expert").IntValue    RoundToFloor(ITMobSpawnMinIntervalExpert.FloatValue spawn_multi);
        
FindConVar("z_mega_mob_spawn_max_interval").IntValue                    RoundToFloor(ITMegaMobSpawnMaxInterval.FloatValue spawn_multi);
        
FindConVar("z_mega_mob_spawn_min_interval").IntValue                    RoundToFloor(ITMegaMobSpawnMinInterval.FloatValue spawn_multi);
        
FindConVar("director_special_respawn_interval").IntValue                RoundToFloor(ITDirectorSpecialRespawnInterval.FloatValue spawn_multi);
        
FindConVar("director_special_battlefield_respawn_interval").IntValue    RoundToFloor(ITDirectorSpecialBattlefieldRespawnInterval.FloatValue spawn_multi);
        
FindConVar("director_special_finale_offer_length").IntValue                RoundToFloor(ITDirectorSpecialFinaleOfferLength.FloatValue spawn_multi);
        
FindConVar("director_special_initial_spawn_delay_max").IntValue            RoundToFloor(ITDirectorSpecialInitialSpawnDelayMax.FloatValue spawn_multi);
        
FindConVar("director_special_initial_spawn_delay_max_extra").IntValue    RoundToFloor(ITDirectorSpecialInitialSpawnDelayMaxExtra.FloatValue spawn_multi);
        
FindConVar("director_special_initial_spawn_delay_min").IntValue            RoundToFloor(ITDirectorSpecialInitialSpawnDelayMin.FloatValue spawn_multi);
        
FindConVar("director_special_original_offer_length").IntValue            RoundToFloor(ITDirectorSpecialOriginalOfferLength.FloatValue spawn_multi);
        }



PHP Code:
void AutoDifficultyCheck()
{
    
int extrasurvivors GetSurvivorTeam() - 4;
    
extrasurvivors = (extrasurvivors 0) ? extrasurvivors 0;  // Don't make game easier if less than 4 survivors 
    
    
float TankHp_Multi TankHpMulti.FloatValue extrasurvivors// More Survivors = More Tank Health
    
float setHP;
    
char z_difficulty[16];
    
GetConVarString(FindConVar("z_difficulty"), z_difficultysizeof(z_difficulty));
    if (
AreInfectedAllowed())
        
setHP TankVersusHealth.FloatValue;
    else if (
StrEqual(z_difficulty"Impossible"false))
        
setHP TankExpertHealth.FloatValue;
    else if (
StrEqual(z_difficulty"Hard"false))
        
setHP TankAdvancedHealth.FloatValue;
    else if (
StrEqual(z_difficulty"Normal"false))
        
setHP TankNormalHealth.FloatValue;
    else if (
StrEqual(z_difficulty"Easy"false))
        
setHP TankEasyHealth.FloatValue;
    
FindConVar("z_tank_health").IntValue RoundToNearest(setHP TankHp_Multi);

    
float spawn_multi CiSpMulti.FloatValue extrasurvivors ;    // More Survivors = More Commons
    
if (CiSpMulti.BoolValue)
    {
    
FindConVar("z_mob_spawn_finale_size").IntValue    RoundFloat(CIMobSpawnFinaleSize.FloatValue*spawn_multi);
    
FindConVar("z_mob_spawn_max_size").IntValue     RoundFloat(CIMobSpawnMaxSize.FloatValue*spawn_multi);
    
FindConVar("z_mob_spawn_min_size").IntValue        RoundFloat(CIMobSpawnMinSize.FloatValue*spawn_multi);
    
FindConVar("z_mega_mob_size").IntValue            RoundFloat(CIMegaMobSize.FloatValue*spawn_multi);
    
FindConVar("z_common_limit").IntValue            RoundFloat(CICommonMobLimit.FloatValue*spawn_multi);
    
FindConVar("z_background_limit").IntValue        RoundFloat(CIBackgroundMobSize.FloatValue*spawn_multi);

    if(
ITHordeTimers.BoolValue)// Should timers be affected too?
        
{
        
FindConVar("z_mob_spawn_max_interval_easy").IntValue    RoundToFloor(ITMobSpawnMaxIntervalEasy.FloatValue spawn_multi);
        
FindConVar("z_mob_spawn_max_interval_normal").IntValue    RoundToFloor(ITMobSpawnMaxIntervalNormal.FloatValue spawn_multi);
        
FindConVar("z_mob_spawn_max_interval_hard").IntValue    RoundToFloor(ITMobSpawnMaxIntervalHard.FloatValue spawn_multi);
        
FindConVar("z_mob_spawn_max_interval_expert").IntValue    RoundToFloor(ITMobSpawnMaxIntervalExpert.FloatValue spawn_multi);
        
FindConVar("z_mob_spawn_min_interval_easy").IntValue    RoundToFloor(ITMobSpawnMinIntervalEasy.FloatValue spawn_multi);
        
FindConVar("z_mob_spawn_min_interval_normal").IntValue    RoundToFloor(ITMobSpawnMinIntervalNormal.FloatValue spawn_multi);        
        
FindConVar("z_mob_spawn_min_interval_hard").IntValue    RoundToFloor(ITMobSpawnMinIntervalHard.FloatValue spawn_multi);
        
FindConVar("z_mob_spawn_min_interval_expert").IntValue    RoundToFloor(ITMobSpawnMinIntervalExpert.FloatValue spawn_multi);
        
FindConVar("z_mega_mob_spawn_max_interval").IntValue                    RoundToFloor(ITMegaMobSpawnMaxInterval.FloatValue spawn_multi);
        
FindConVar("z_mega_mob_spawn_min_interval").IntValue                    RoundToFloor(ITMegaMobSpawnMinInterval.FloatValue spawn_multi);
        
FindConVar("director_special_respawn_interval").IntValue                RoundToFloor(ITDirectorSpecialRespawnInterval.FloatValue spawn_multi);
        
FindConVar("director_special_battlefield_respawn_interval").IntValue    RoundToFloor(ITDirectorSpecialBattlefieldRespawnInterval.FloatValue spawn_multi);
        
FindConVar("director_special_finale_offer_length").IntValue                RoundToFloor(ITDirectorSpecialFinaleOfferLength.FloatValue spawn_multi);
        
FindConVar("director_special_initial_spawn_delay_max").IntValue            RoundToFloor(ITDirectorSpecialInitialSpawnDelayMax.FloatValue spawn_multi);
        
FindConVar("director_special_initial_spawn_delay_max_extra").IntValue    RoundToFloor(ITDirectorSpecialInitialSpawnDelayMaxExtra.FloatValue spawn_multi);
        
FindConVar("director_special_initial_spawn_delay_min").IntValue            RoundToFloor(ITDirectorSpecialInitialSpawnDelayMin.FloatValue spawn_multi);
        
FindConVar("director_special_original_offer_length").IntValue            RoundToFloor(ITDirectorSpecialOriginalOfferLength.FloatValue spawn_multi);
        }
    } 
__________________

Last edited by Spirit_12; 06-06-2020 at 17:16.
Spirit_12 is offline
Silvers
SourceMod Plugin Approver
Join Date: Aug 2010
Location: SpaceX
Old 06-06-2020 , 18:25   Re: [L4D(2)] SuperVersus [1.5.4]
Reply With Quote #1290

FindConVar is cached SM side now-a-days, not sure since which SM version. Sure it's still a bit faster to cache yourself, and a bit faster again to use cvar change hooks to only read once/on change but it's not as slow as it used to be. Still, something I recommend and will always do in my own plugins. When you have a server with increased tickrate, 250+ plugins these small changes done in most plugins really go a long way to increase server performance, and considering this plugin is for increased slots I'm sure it'll help. Not sure how often they're actually called in this plugin, unlike some where cvars are queried in OnGameFrame, Think functions or fast repeating timers, that's really where optimizing helps.
__________________
Silvers is offline
Reply


Thread Tools
Display Modes

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 05:30.


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