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

[L4D & L4D2] Fire Glow (1.8) [25-Mar-2022]


Post New Thread Reply   
 
Thread Tools Display Modes
Author
Silvers
SourceMod Plugin Approver
Join Date: Aug 2010
Location: SpaceX
Plugin ID:
2984
Plugin Version:
1.8
Plugin Category:
Gameplay
Plugin Game:
Left 4 Dead
Plugin Dependencies:
    Servers with this Plugin:
    85 
    Plugin Description:
    Creates a dynamic light where Molotovs, Gascans and Firework Crates burn.
    Old 06-01-2012 , 22:47   [L4D & L4D2] Fire Glow (1.8) [25-Mar-2022]
    Reply With Quote #1




    (Thanks to "Lux" for the gif)


    Related Plugins:

    About:
    • Creates a dynamic light where Molotovs, Gascans and Firework Crates burn.
    • The light flickers and fades in and out.
    • Maximum of 8 lights simultaneously. Recompile changing "define MAX_LIGHTS" value if you want more.
    • The games cvar inferno_flame_lifetime sets how long Molotovs, Gascans and Firework Crates burn for.
    • If you want to change, save sm_cvar inferno_flame_lifetime 15 to your servers cfgs\server.cfg.
    • 15 is the default value, but you can change. This plugin will adapt the light time.
    • Game Bug: Fire particles disappear after 15 seconds regardless of the cvar inferno_flame_lifetime. Damage still occurs until the time ends.


    Thanks:
    • irogue - For the request.
    • Don't Fear The Reaper - Testing and light fade idea.
    • bubbabyte - Found a major bug before release.
    • disawar1 - Helped testing.
    • Lux - Updating with smooth transitions.


    Cvars:

    Saved to l4d_fire_glow.cfg in your servers \cfg\sourcemod\ folder.

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

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

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

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

    // How far does the dynamic light illuminate the area.
    l4d_fire_glow_distance "250.0"

    // The light color for Firework Crate explosions. Three values between 0-255 separated by spaces. RGB Color255 - Red Green Blue.
    l4d_fire_glow_fireworks "255 100 0"

    // The light color for Molotov and Gascan fires. Three values between 0-255 separated by spaces. RGB Color255 - Red Green Blue.
    l4d_fire_glow_inferno "255 25 0"

    // Fire Glow plugin version.
    l4d_fire_glow_version 

    Changes:
    Code:
    1.8 (25-Mar-2022)
        - Better fade in and out timing.
    
    1.7 (22-Mar-2022)
        - Changed the method for fading lights in and out hopefully preventing random server crash.
    
    1.6 (12-Jul-2020)
        - Added smoother fading of the light, thanks to "Lux" for coding in.
    
    1.5 (10-May-2020)
        - Extra checks to prevent "IsAllowedGameMode" throwing errors.
        - Various changes to tidy up code.
    
    1.4 (01-Apr-2020)
        - Fixed "IsAllowedGameMode" from throwing errors when the "_tog" cvar was changed before MapStart.
    
    1.3 (05-May-2018)
        - Converted plugin source to the latest syntax utilizing methodmaps. Requires SourceMod 1.8 or newer.
        - Changed cvar "l4d_fire_glow_modes_tog" now supports L4D1.
    
    1.2 (30-Jun-2012)
        - Fixed the plugin not working in L4D1.
    
    1.1 (20-Jun-2012)
        - Added cvars "l4d_fire_glow_modes", "l4d_fire_glow_modes_off" and "l4d_fire_glow_modes_tog" to control which modes turn on the plugin.
    
    1.0 (02-Jun-2012)
        - Initial release.

    Installation:
    • Click "Get Plugin" and put the .smx file into your servers \addons\sourcemod\plugins\ folder.
    Attached Files
    File Type: sp Get Plugin or Get Source (l4d_fire_glow.sp - 2262 views - 14.1 KB)
    __________________

    Last edited by Silvers; 03-06-2024 at 06:09.
    Silvers is offline
    DrDarkTempler
    Member
    Join Date: Apr 2012
    Old 06-02-2012 , 01:24   Re: [L4D & L4D2] Fire Glow (1.0) [02-Jun-2012]
    Reply With Quote #2

    Thanks, installed it on my l4d1 server and it works wonderfully, create realistic effect, BUT hehe, i think is too redish/orange lol other then that it works fine
    DrDarkTempler is offline
    asto
    Member
    Join Date: Aug 2010
    Old 06-02-2012 , 06:23   Re: [L4D & L4D2] Fire Glow (1.0) [02-Jun-2012]
    Reply With Quote #3

    Ohh yes. This is great plugin!

    Several problems can be solved by dynamic light.
    asto is offline
    matrixmark
    Senior Member
    Join Date: Jun 2010
    Old 06-03-2012 , 02:58   Re: [L4D & L4D2] Fire Glow (1.0) [02-Jun-2012]
    Reply With Quote #4

    Nice plugin this makes the fire look more realistic i think.
    matrixmark is offline
    irogue
    Senior Member
    Join Date: Jan 2011
    Location: Australia
    Old 06-15-2012 , 04:26   Re: [L4D & L4D2] Fire Glow (1.0) [02-Jun-2012]
    Reply With Quote #5

    Thanks for adding this SIlvers, i was away recently and had not expected to get such a fast response and an even faster finished plugin at that.

    The plugin is epic mate, really adds a great deal of atmosphere to events when gas cans etc go off in dark areas especially.

    Kudos mate ty again! :-)
    irogue is offline
    djflorfila
    New Member
    Join Date: Oct 2011
    Old 08-29-2012 , 02:25   Re: [L4D & L4D2] Fire Glow (1.2) [30-Jun-2012]
    Reply With Quote #6

    Nice plugin! Really Work! =)))
    djflorfila is offline
    Lux
    Veteran Member
    Join Date: Jan 2015
    Location: Cat
    Old 07-11-2020 , 23:46   Re: [L4D & L4D2] Fire Glow (1.5) [10-May-2020]
    Reply With Quote #7

    Hey made a change to lighting transition for fires to be less abrupt on ignition and extinguish transitions.

    replace this function with code.below to have effect.

    Enjoy

    PHP Code:
    public Action TimerCreate(Handle timerany target)
    {
        if( (
    target EntRefToEntIndex(target)) != INVALID_ENT_REFERENCE )
        {
            
    int index = -1;

            for( 
    int i 0MAX_LIGHTSi++ )
            {
                if( 
    IsValidEntRef(g_iEntities[i][0]) == false )
                {
                    
    index i;
                    break;
                }
            }

            if( 
    index == -)
                return;
        
            
    char sTemp[64];
            
    GetEdictClassname(targetsTemp2);
            
    int entity CreateEntityByName("light_dynamic");
            if( 
    entity == -1)
            {
                
    LogError("Failed to create 'light_dynamic'");
                return;
            }

            
    g_iEntities[index][0] = EntIndexToEntRef(entity);
            
    g_iEntities[index][1] = EntIndexToEntRef(target);

            
    float fInfernoTime g_fInferno;
            if( 
    sTemp[0] == 'i' )
            {
                
    Format(sTempsizeof(sTemp), "%s 255"g_sCvarCols2);
            }
            else
            {
                
    fInfernoTime -= 1.5;
                
    Format(sTempsizeof(sTemp), "%s 255"g_sCvarCols1);
            }

            
    DispatchKeyValue(entity"_light"sTemp);
            
    DispatchKeyValue(entity"brightness""3");
            
    DispatchKeyValueFloat(entity"spotlight_radius"32.0);
            
    DispatchKeyValueFloat(entity"distance"5.0);
            
    DispatchKeyValue(entity"style""6");
            
    DispatchSpawn(entity);

            
    float vPos[3], vAng[3];
            
    GetEntPropVector(targetProp_Data"m_vecOrigin"vPos);
            
    GetEntPropVector(targetProp_Data"m_angRotation"vAng);
            
    vPos[2] += 40.0;
            
    TeleportEntity(entityvPosvAngNULL_VECTOR);
            
    AcceptEntityInput(entity"TurnOn");
            
            
    int iTickRate RoundFloat(GetTickInterval());
            
    float flTickInterval GetTickInterval();
            
            
    // Fade in
            
    for(int i 1<= iTickRatei++)
            {
                
    Format(sTempsizeof(sTemp), "OnUser1 !self:distance:%f:%f:-1", (g_fCvarDist iTickRate) * iflTickInterval i);
                
    SetVariantString(sTemp);
                
    AcceptEntityInput(entity"AddOutput");
            }
            
    AcceptEntityInput(entity"FireUser1");
            
            
    // Fade out
            
    for(int i iTickRate1; --i)
            {
                
    Format(sTempsizeof(sTemp), "OnUser2 !self:distance:%f:%f:-1", (g_fCvarDist iTickRate) * ifInfernoTime flTickInterval i);
                
    SetVariantString(sTemp);
                
    AcceptEntityInput(entity"AddOutput");
            }
            
    AcceptEntityInput(entity"FireUser2");

            
    Format(sTempsizeof(sTemp), "OnUser3 !self:Kill::%f:-1"fInfernoTime);
            
    SetVariantString(sTemp);
            
    AcceptEntityInput(entity"AddOutput");
            
    AcceptEntityInput(entity"FireUser3");
        }

    __________________
    Connect
    My Plugins: KlickME
    [My GitHub]

    Commission me for L4D
    Lux is offline
    Silvers
    SourceMod Plugin Approver
    Join Date: Aug 2010
    Location: SpaceX
    Old 07-12-2020 , 00:27   Re: [L4D & L4D2] Fire Glow (1.6) [12-Jul-2020]
    Reply With Quote #8

    Added to update, thanks.
    __________________
    Silvers is offline
    HarryPotter
    Veteran Member
    Join Date: Sep 2017
    Location: Taiwan, Asia
    Old 01-23-2022 , 09:00   Re: [L4D & L4D2] Fire Glow (1.6) [12-Jul-2020]
    Reply With Quote #9

    Hi Silvers, sorry to bother.

    Yesterday I encounter the crash.
    Crash ID: 3BVS-RIQK-TXWI
    Spoiler

    Judging by crash stack, I think this is related to fire light_dynamic.
    (I am not sure, correct me if I am wrong)
    __________________

    Last edited by HarryPotter; 01-23-2022 at 09:00.
    HarryPotter is offline
    Toranks
    Senior Member
    Join Date: Dec 2021
    Location: Spain
    Old 03-06-2022 , 04:03   Re: [L4D & L4D2] Fire Glow (1.6) [12-Jul-2020]
    Reply With Quote #10

    Is there a possibility to generate lights also on a burning tank or SI?
    Toranks 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 14:25.


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