During lots of my time working with just the Coop game mode for L4D2, I ran into various limitations here and there. Continued frustration with the Director never listening to the cvars I set in my server configuration files, led me wandering for answers as to why. The answer was:
Or dvars for short if you want be cool. With dvars, game modes have a lot more freedom regarding the game play and various variables the Director employs to pace the game. Of course that also means Director will be an ass and no longer listen to customized cvars in your server configuration files if the game mode happen to specify otherwise.
Unacceptable. However thanks to the Left 4 Downtown 2 extension, as always, we can override various "script values" which the Director reads from game mode .nut files.
Unlimited SI for everyone!
Just to reiterate. This plugin does nothing other than apply fancy make up to already provided forwards from Left 4 Downtown 2. This plugin also offers a include script for other plugins to easy alter dvars. Neat!
Lots of love to Sev, as always, for putting up with my rants and various shit.
Allow plugins and administrators to change director variables, "dvars", without messing with VScripts.
Code: sm_dvarlist - Prints a list of all indexed director variables to console
sm_dvar <dvar> [value] - Show or set value of a director variable
sm_resetdvar <dvar> - Reset value of a director variable
sm_dvarbounds <dvar> <upper|lower> [0|1] [value] - Show or set bound value of a director variable
sm_silentdvar <dvar> [value] - Show or set value of a director variable, without showing activity
sm_silentresetdvar <dvar> - Reset value of a director variable, without showing activity
sm_silentdvarbounds <dvar> <upper|lower> [0|1] [value] - Show or set bound value of a director variable, without showing activity
Known Problems / Things to Notice:
No customizable cvars are featured in this plugin.
- This plugin require the Left 4 Downtown 2 extension.
- Dvars can only be changed post being indexed by this plugin, which occurs after Director queries the variable for the first time. This means on the first map after server reboot, most dvars are not indexed yet and can not be altered, such as EscapeSpawnTanks. This plugin will silently error out (However it will print a message to the admin issuing command and/or server) if unable to find wanted dvar. There is no problem with placing plugin commands in configuration files for later application (once the wanted variable have been indexed).
- It goes without saying that dvars the Director never queries is never obeyed. That means TankHitDamageModifierVersus is not used in Coop and ScavengeClusterBonusTime is not used outside scavenge game mode. Furthermore challenge dvars are not used at all if not in a 'challenge' game mode. Challenge dvars are prefixed with "cm_".
- Use sm_dvarlist to see current indexed director variables and their values.
- A great community-made list of Director Variables can be found at the Valve Developer Wiki, here.
Code: Version 2.1.1 2014-08-07
Initial public release.
Attached Files directorvariables_release.zip (43.7 KB)
Wyświetl pełny artykuł