View Single Post
V1SoR
Member
Join Date: Jan 2011
Old 06-15-2013 , 07:05   Re: [EXTENSION] Left 4 Downtown 2 (0.5.4.2) - L4D2 Only, Updated Left4Downtown
Reply With Quote #397

I recommend everybody to switch to my fork of this project, since the original authors had given up on it.

I am constantly updating the project. The newest, but not yet released version 0.5.8 has three new different forwards for SourceMod:
  • L4D2_OnNavAreaChanged(client) -- an effective detour for tracking player progress throughout the map. Initially implemented for my distance-based competitive scoring mod, but can be easily used as a superior, from server resources conservation potential perspective, alternative for OnGameFrame()/OnPlayerRunCmd().
  • L4D2_OnWaterMove(client) -- once again, meant to conserve precious server resources. Currently, OnGameFrame() is used in plugins(including Confogl core and AtomicStryker's variant) to slow down survivor movement in the water. It is best to avoid the use of these functions altogether, especially on a server with an increased tickrate/unlocked fps_max cvar.
  • L4D2_OnStagger(target, source) -- fires whenever someone gets staggered. Meant for my 'No SI Friendly Stagger' plugin. Boomer explosions, running witches and charger wall impacts no longer stumble fellow zombies, as well as don't cause the captured Survivor to let off.

I will post my entire message from a different forum for the sake of convenience. However, keep in mind that Left4Downtown2 has long since become a competitvely-oriented project. Thus my post may seem a bit too condensed and directional. Also, keep in mind it's a 0.5.5 changelog, which is the most recent released version.

******

This is a small update to the Left4Downtown extension, designed mostly for CCT2. The newly added feature allows the server to force its joining clients into disabling their addons. Exceptions are possible and can be implemented on the SourceMod plugins level.

The reason behind this is that the traditional VPK-ish Addon Disabler doesn't work properly with custom campaigns. And even if it would, the L4D2 engine specifics would require a different VPK file for each custom campaign. So much for pragmatism.

How does it work?
First off, you must set the l4d2_addons_eclipse cvar to 1(default is 0) in order to enable this functionality.

With this cvar set at 1, a forward will be sent out to Sourcemod whenever a connecting client's eligibility for addons is about to be decided:
Code:

PHP Code:
/**
 * @brief Called when UpdateAddonEclipseContentCvar(char, char) is available for invocation(clientside)
 * @remarks Doesn't fire if l4d2_addons_eclipse equals 0.
 *
 * @param client the client the cvar is being set for
 *
 * @return Pl_Handled to let the client through with addons, Pl_Continue otherwise.
 */
forward Action:L4D2_OnAddonsEclipseUpdate(client); 
From here on, you may implement your own custom filtering rules.

Say, you want all casters to be let through with addons. In this case, you can create a local keyvalues storage with all the casters' SteamIDs and implement an appropriate checking algorithm. Or, you can simply add into your l4dready the following piece of code:
Code:
PHP Code:
public Action:L4D2_OnAddonsEclipseUpdate(client)
{
    if(
IsClientCaster(client)) 
        return 
Plugin_Handled;
        
    return 
Plugin_Continue;

This will allow any caster to skip the check. However, note that he'd have to rejoin the server after typing the !cast command. Trying to force the client into disabling his addons while he's fully in-game would inevitably lead to a CTD.

Known issues
  • Enabling the cvar mid-game may cause some clients(mostly those with custom skin models) to CTD on level transition. The reason for this is because the client decides to either keep or unload the addons only during his connection to the server, when you can see the campaign poster. That's the only place to safely unload all addons and you should keep it that way. Attempting to unload them on map transitions is a gamble and does not bode well for a selected category of players.
  • Typically, all addons get unloaded just fine and the client procedes on into joining the game. However, some 'badass' addons like nosound(coupled with soundcache exploit) or numerous texture replacements are potentially able to cause a CTD. The solution is rather simple. They must be disabled manually from the in-game menu and the player must restore all his sounds back into their native place.
  • Addons using custom post-processing/color correction effects may leave a small amount of pink mist in the place where their triggers are firing. This only applies to native campaigns, modified via Stripper. If you don't play Confogl Sky with its special addon, you most likely will never notice this visual artifact.

If you encounter any other bugs, please let me know.

Download:

Left4Downtown2 v0.5.5 w/ player slots patching
Left4Downtown2 v0.5.5 w/out player slots patching

Last edited by V1SoR; 06-15-2013 at 07:16.
V1SoR is offline