Raised This Month: $12 Target: $400
 3% 

[L4D & L4D2] Weather Control (1.17) [12-Mar-2024]


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author
Silvers
SourceMod Plugin Approver
Join Date: Aug 2010
Location: SpaceX
Plugin ID:
2942
Plugin Version:
1.17
Plugin Category:
Gameplay
Plugin Game:
Left 4 Dead
Plugin Dependencies:
    Servers with this Plugin:
    52 
    Plugin Description:
    Create storms, lightning, fog, rain, wind, changes the skybox, sun and background colors.
    Old 05-10-2012 , 03:48   [L4D & L4D2] Weather Control (1.17) [12-Mar-2024]
    Reply With Quote #1



    Thanks:
    • Dragokas - Writing most of the L4D1 support conversion.
    • bubbabyte - Lots of testing on their server. Created custom storms and descriptions for the data config.
    • disawar1 (raziEiL) - Lots of bug reports and testing on their server.
    • Herbie - Lots of testing on their server.
    • Optics
    • alexip121093
    • Mr. Man
    • [Resistance] Yoshi
    • JoBarfCreepy
    • Sev
    • Worminater
    • Chatyak


    About:
    • Read/search this post before asking questions.
    • Supports L4D1 since version 1.14! (Various elements of the plugin will remain prefixed with "l4d2").
    • Does not affect the Hard Rain storm (L4D2).
    • View the data config to customise storm settings for all maps or individual specific maps.
    • The fog can disappear if you reset the maps weather when the weather state is transitioning between idle/storm.
    • Multiple triggers can be saved and sized, which trigger the storm to start when a Survivor walks through. Use the sm_storm command and menu.
    • The triggers are saved to l4d2_storm_triggers.cfg (L4D2 only) or l4d1_storm_triggers.cfg (L4D1 only) in your servers \addons\sourcemod\data\ folder.
    • Chinese config translation for L4D1 can be found here, thanks to "ZBzibing" for providing.


    Bugs:
    Skybox (L4D2 only it seems):
    Users with "low" shader settings will see the black and purple missing texture image if you use a skybox from Valve maps "c1" - "c5" on maps "c8" - "c12". Skyboxes from "c6" - "c13" will do the same on maps "c1" - "c5". "c6", "c7" and "c13" display a blue (or other solid color) background instead of the missing texture image. The "docks_hdr" skybox works fine on all maps for all users.
    Rain:
    Large maps and open areas will cause the game to crash, especially with lower hardware specs. The error message is: "Engine error: too many indices for index buffer. . tell a programmer ( 33096>32768 )". DO NOT report this problem, you can minimise the chances of the crash by setting the "rain" to "1" or "0" on some maps. Or lower the maps far z clip (advanced).


    Skybox:

    L4D2 examples: (Pic1, Pic2, Pic3, Pic4, Pic5)
    • The skybox can be changed in the data config with the key "light_style". Requires reconnecting or a map change to take affect.
    • Available skyboxes, their names and images listed here: (L4D2) and (L4D1).
    • Custom 3rd party skyboxes files should be uploaded on both content server and game server, otherwise it won't work.


    Map Light Style:

    (Pic1, Pic2, Pic3, Pic4)
    • The map light style only affects the world surfaces (walls, ground, etc) and not individual props.
    • The map light style can be changed with the command sm_maplight and the data config key "light_style".
    • This may cause 0.2 seconds of low FPS when changed (may not be noticable). Occurs on a player when they first spawn or for everyone on round start, after 5.5, 8.0 and 10.0 seconds.


    Post Process Effect:

    (Pic1, Pic2, Pic3, Pic4, Pic5)
    • The cvar l4d2_storm_post applies the above post process effect. when weather sets to the storm state.
    • The Mind zombie in the Mutant Zombies plugin conflicts with this effect. Which ever last spawned will override. For example:
    • If the storm state has started after a mind zombie spawns, you will no longer see the mind zombie effect and only see the storm effect, and vice versa.


    Admin Commands: (requires "z" flag)

    PHP Code:
    sm_storm          // Opens the Storm menu.
    sm_stormstart     // Stats the Storm if possible.
    sm_stormstop      // Stops the Storm if possible.
    sm_stormrefresh   // Refresh the plugin, reloading the config and storm.
    sm_stormreset     // Stops the storm and resets the weather to the maps default.
    sm_stormconfig    // Display the currently loaded section from the data config.
    sm_stormpreset    // Displays a menu listing presets from the random section in the data config. Allowing you to select and change the current storm preset.
    sm_lightning      // Creates a Lightning Strike.
    sm_lightningaim   // Creates a Lightning Strike where you are aiming.
    sm_rains          // Toggles the rain on/off.
    sm_snows          // Toggles the snow on/off.
    sm_wind           // Toggles the wind on/off.
    sm_sun            // Set the sun color. Reset with no args. Turn off: sm_sun 0. Set the color with three values between 0-255 separated by spaces: sm_sun <r> <g> <b>.
    sm_fog            // No args toggles the fog on/off. Set the color with three values between 0-255 separated by spaces: sm_fog <r> <g> <b>.
    sm_farz           // Set the maps far z-clip. This will make the map stop rendering stuff after the specified distance. Usage: sm_farz <distance>.
    sm_maplight       // Set the maps lighting. Reset with no args. Usage: sm_maplight: <chars a-z, 1-64 chars allowed. More info: https://developer.valvesoftware.com/wiki/Light#Appearances
    sm_stormset       // Sets the fog, background and sun color. Reset with no args. Set the color with three values between 0-255 separated by spaces: sm_stormset <r> <g> <b>.
    sm_background     // Set the background color. Reset with no args. Set the color with three values between 0-255 separated by spaces: sm_background <r> <g> <b>. 


    CVars:

    Saved to l4d{1,2}_storm.cfg in your servers \cfg\sourcemod\ folder.

    PHP Code:
    // 0=Plugin off, 1=Plugin on.
    l4d2_storm_allow "1"

    // Turn on the plugin in these game modes, separate by commas (no spaces). (Empty = all).
    l4d2_storm_modes ""

    // Turn off the plugin in these game modes, separate by commas (no spaces). (Empty = none).
    l4d2_storm_modes_off ""

    // Turn on the plugin in these game modes. 0=All, 1=Coop, 2=Survival, 4=Versus, 8=Scavenge. Add numbers together.
    l4d2_storm_modes_tog "0"

    // L4D2 only. 0=Off, 1=Turn down the voip voice transmit volume during the storm state.
    l4d2_storm_mixer "1"

    // 0.0=Off. Applies post process effect during the storm state. Values near 0 will blur, lower values cause other effects.
    l4d2_storm_post "-0.50"

    // 0=Off. 1=On. Select a new weather preset from the random section when changing chapter.
    l4d2_storm_random "1"

    // Method to refresh map light style: 0=Old (0.2 sec low FPS, does not the whole world). 1=Almost always lights the whole world (0.5 sec low FPS), 2=Lights the whole world (1 sec low FPS).
    l4d2_storm_style "1"

    // -1=Off. Your servers time offset from UTC time, the maps light style will change depending on the servers time of day. This will overwrite the configs light style setting.
    l4d2_storm_time "-1"

    // Weather Control plugin version.
    l4d2_storm_version 


    Config:

    Saved to l4d2_storm.cfg (L4D2) or l4d1_storm.cfg (L4D1) in your servers \addons\sourcemod\data\ folder.

    The config controls weather effects on maps you specify. All the available keys are in the "all" section of the config.

    For changes to take affect, you must either:
    A) Use the command sm_stormrefresh.
    B) Open the menu with sm_storm and press "5. Refresh" on the menu.
    C) Reload the plugin.
    D) Change map.


    The "Main" section:
    The "main" section will create a storm on all maps with these settings. Any map specific settings will load instead.
    Used to create storms on all maps unless the map name is specified as a section in the data config.

    Map specific section:
    Put the map name as the section value. For example "c1m1_hotel". This allows map specific weather.

    If you have a main section, you can make the map load those settings by adding the key and value: "use_section" "main".
    After the "use_section" data loads, map specific data will load and any set values will override.

    View the l4d2_storm.cfg config for examples in the "c1m1_hotel" and other map specific sections.

    "use_section" key:
    Attempts to load data from the section name you put as the "use_section" value.
    If the Value is set to "all" it will load settings from the "all" section.
    After the "use_section" data loads, map specific data will load and any set values will override.

    This allows standard weather settings from the "use_section" and custom settings for specific maps.
    "" =Off, this is the default value which will disable loading custom information.

    Random Storm Selection:
    You can set up many custom storm types to be chosen at random when the map loads.
    You can have as many preset storms as you like by simply adding or adjusting the count number and names that you see below.

    Set the "count" key to the number of sections to randomly select from. Specify each key as an incremental number from 1. Each keys value should point to a section in the config.

    Here is an example where the map "c1m2_streets" will load either red, green or blue fog.
    PHP Code:
        "c1m2_streets"
        
    {
            
    "use_section"    "some_random"
        
    }
        
    "some_random"
        
    {
            
    "count"      "3"
            "1"              "SectionRed"
            "2"              "SectionGreen"
            "3"              "Blue"
        
    }
        
    "SectionRed"
        
    {
            
    "background"     "255 0 0"
            "fog_color"      "255 0 0"
        
    }
        
    "SectionGreen"
        
    {
            
    "background"     "0 255 0"
            "fog_color"      "0 255 0"
        
    }
        
    "Blue"
        
    {
            
    "background"     "0 0 255"
            "fog_color"      "0 0 255"
        
    }



    Changes:
    Code:
    1.17 (12-Mar-2024)
        - Added configuration for the "sun_overlaysize" and "sun_size", for idle and storm weather. Thanks to "glhf3000" for writing the code.
        - Added data config keys: "sun_overlaysize", "sun_size" and "sun_overlaysize_storm", "sun_size_storm" to set the sun size.
    
    1.16 (05-Mar-2024)
        - Fixed invalid entity error. Thanks to "HarryPotter" for reporting.
    
    1.15 (05-Jul-2022)
        - Added feature: dynamic light glow effect for the fire created by a lightning strike.
        - Added command "sm_lightningaim" to display a lightning strike where you are aiming.
    
        - Plugin is now compiled with SourceMod 1.11.
    
    1.14 (01-May-2022)
        - Added cvar "l4d2_storm_time" to change the maps light style according to the server time.
        - Added command "sm_stormpreset" to display a menu for selecting different presets (does not affect skybox).
        - Added command "sm_stormconfig" to display the currently loaded section from the data config.
        - Added command "sm_snows" to toggle the Snow effect.
    
        >> L4D1 support:
        - Plugin now supports L4D1!
        - The plugin filename and cvars will remain prefixed with "l4d2" to keep compatibility.
        - Many sound files and particles are missing. Sound files have been attached to the post for L4D1.
        - Server owners will have to find their own way of downloading these to clients. I will not provide support.
    
        - Merged changes thanks to "Dragokas":
    
        1.8.5 (fork by Dragokas) - (19-Jun-2021)
            - No need to define default skybox any more. It is detected automatically.
    
        1.8.4 (fork by Dragokas)
            - L4D1 compatibility: removed g_iStormLayer and g_iVoip entities.
    
        1.8.3 (fork by Dragokas) private
            - Added downloading skyboxes to client depending on current map they used
    
        1.8.2 (fork by Dragokas)
            - Added changing daylight time according to the real time in server (require testing).
    
        1.8.1 (fork by Dragokas)
            - Added basic support for L4D1.
            - Unlocked ability to call "sm_" commands from server console or 3d-party plugins.
            - PARTICLE_LIGHT1 and PARTICLE_LIGHT2 removed when L4D1 is run (these particles are absent).
            - Added checking for map start before CreateEntityByName call (CreateWind).
    
    1.13 (30-Nov-2021)
        - Added data config key "time_of_day" to modify the servers "sv_force_time_of_day" cvar value. Requested by "EternalStar".
        - Added data config key "trigger_pourgas" to trigger the storm by chance when pouring a gascan. Requested by "EternalStar".
        - Added data config key "trigger_scavenge" to trigger the storm by chance when Scavenge overtime starts. Requested by "EternalStar".
        - Fixed not overriding the "trigger_finale" key value from a map specific section.
        - Fixed not overriding the "trigger_witch_alert" key value from a map specific section.
    
    1.12 (24-Nov-2021)
        - Added data config key "post_process_idle" and "post_process_storm" to modify post process effects. Will override the cvar value. Requested by "EternalStar".
        - Added a debug define to log some information for help in tracking down issues.
        - Compatibility support for SourceMod 1.11. Fixed various warnings.
    
    1.11 (30-Sep-2020)
        - Fixed compile errors on SM 1.11.
        - Removed an unused variable.
    
    1.10 (10-May-2020)
        - Extra checks to prevent "IsAllowedGameMode" throwing errors.
        - Various changes to tidy up code.
        - Various optimizations and fixes.
    
    1.9 (01-Apr-2020)
        - Fixed "IsAllowedGameMode" from throwing errors when the "_tog" cvar was changed before MapStart.
    
    1.8.2 (30-Oct-2019)
        - Lightning no longer spams "Setting CBaseEntity to non-brush model" to server console. Model not required for small boxes.
    
    1.8.1 (28-Jun-2019)
        - Changed PrecacheParticle method.
        - Better fading wind and rain sound effects volume.
    
    1.8 (14-Aug-2018)
        - Added cvar "l4d2_storm_random" to control if a new weather preset is selected from the "random" section on each chapter or only the first.
        - Added data config key "rain_type", to control which type of rain to use. 0=Default. 4=Particle Rain. 6=Particle Rain Storm.
        - Copied 'Hard Rain' rain values as suggested by "Lux".
        - Rain particles (not type 0), are invisible to clients with low graphic settings, and in some parts of maps (due to how the engine works).
    
    1.7 (05-May-2018)
        - Converted plugin source to the latest syntax utilizing methodmaps. Requires SourceMod 1.8 or newer.
    
    1.6 (12-Aug-2013)
        - Added snow.
        - Added command "sm_snows" to toggle snow on and off.
        - Added data config keys "snow", "snow_idle", "snow_storm", to control when snow is enabled.
        - Fixed duplicate key entry for "fog_idle_start" in the data. Replaced with the correct "fog_storm_start" key.
    
    1.5 (23-May-2012)
        - Missing data config keys "rain_idle" and "rain_storm" will use default values "75" and "250" respectively.
        - Fixed creating entities when the map has not started.
    
    1.4 (21-May-2012)
        - Fixed the fog disappearing when weather is reset during a transition between idle/storm.
    
    1.3 (20-May-2012)
        - Added data config keys "rain_idle" and "rain_storm" to control the visibility of rain, requested by "adrianman".
    
    1.2 (17-May-2012)
        - Fixed a bug with the fog when resetting the map, which caused the bots to not see properly.
    
    1.1 (15-May-2012)
        - Added cvar "l4d2_storm_style". Method to refresh map light style: 0=Old (0.2 sec low FPS, does not the whole world). 1=Almost always lights the whole world (0.5 sec low FPS), 2=Lights the whole world (1 sec low FPS).
        - Added command "sm_farz" to set the maps far z-clip. This will make the map stop rendering stuff after the specified distance.
        - Added data config keys "far_z_idle" and "far_z_storm" which control the maps far z-clip when the weather is idle/storm.
        - Added data config key "lightning_time" to control how long fires burn when lightning strikes the ground.
    
    1.0 (10-May-2012)
        - Initial release.


    Installation:
    Updating from 1.13 or older:
    • New cvars have been added: use the Cvar Configs Updater, or delete the old cvars config or manually add them.
    Attached Files
    File Type: zip l4d2_storm.zip (86.4 KB, 79 views)
    __________________

    Last edited by Silvers; 03-12-2024 at 07:02.
    Silvers is offline
     


    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 10:41.


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